clay584.genie.learn_genie (0.1.11) — module

This module utilizes the Cisco PyATS/Genie framework to "learn" features from network devices.

| "added in version" 2.9 of clay584.genie"

Authors: Clay Curtis (@ccurtis584)

preview | supported by community

Install collection

Install with ansible-galaxy collection install clay584.genie:==0.1.11


Add to requirements.yml

  collections:
    - name: clay584.genie
      version: 0.1.11

Description

This module allows for the user of the Ansible module to reach out to a network device and pull back CLI data, parse it, and 'learn' the entirety of a given feature on a network device.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Learn the state of BGP
- name: Learn BGP Feature
  learn_genie:
    host: 10.1.1.1
    username: admin
    password: password1234
    os: iosxe
    feature: bgp

Inputs

    
os:
    description:
    - Network operating system of the device
    required: true

host:
    description:
    - The network device that PyATS/Genie should connect to
    required: true

port:
    description:
    - The port number for SSH on the device
    required: false

colors:
    description:
    - Turn on or off colored diff output. Defaults to on (colored output). Requires Python
      package "colorama".
    required: false

exclude:
    description:
    - Exclude noisy keys such as packet counters, timestamps, uptime, etc.
    required: false

feature:
    description:
    - The device feature to be learned from the device
    required: true

password:
    description:
    - The password used to connect to the device
    required: true

username:
    description:
    - The username used to connect to the device
    required: true

compare_to:
    description:
    - Compare to prior genie learn data (diff)
    required: false

no_default_exclusion:
    description:
    - Do not exclude any noisy keys in the Genie diff operation such as packet counters,
      timestamps, uptime, etc.
    required: false

Outputs

feature_data:
  description: An OS-agnostic data structure for the feature which will be the same
    regardless of device operating system.
  returned: always
  type: dict