cisco.radkit.genie_learn module – Runs a command via RADKit, then through genie parser, returning a parsed result
Note
This module is part of the cisco.radkit collection (version 2.0.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install git+https://wwwin-github.cisco.com/scdozier/cisco.radkit-ansible.git
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: cisco.radkit.genie_learn
.
New in cisco.radkit 0.2.0
Synopsis
Runs a command via RADKit, then through genie parser, returning a parsed result
Requirements
The below requirements are needed on the host that executes this module.
radkit
Parameters
Parameter |
Comments |
---|---|
Alternate path to client ca cert for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_CA_PATH will be used instead. |
|
Alternate path to client cert for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_CERT_PATH will be used instead. |
|
Client certificate password in base64 If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_PRIVATE_KEY_PASSWORD_BASE64 will be used instead. |
|
Alternate path to client key for RADKIT If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_CLIENT_KEY_PATH will be used instead. |
|
Name of device as it shows in RADKit inventory |
|
Specifies how many seconds RADKit will for command to complete Can optionally set via environemnt variable RADKIT_ANSIBLE_EXEC_TIMEOUT Default: |
|
Attrbute to match RADKit inventory, which can select multiple devices at once. (use with filter_pattern, ex ‘name’) |
|
Pattern to match RADKit inventory, which can select multiple devices at once. (use instead of device_name) |
|
Identity to authentiate with RADKit (xxxx@cisco.com). If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_IDENTITY will be used instead. |
|
models to execute on device |
|
The device OS (if omitted, the OS found by fingerprint) Default: |
|
Removes the model and device keys from the returned value when running a single model against a single device. NOTE; This does not work with diff Choices:
|
|
Radkit service serial If the value is not specified in the task, the value of environment variable RADKIT_ANSIBLE_SERVICE_SERIAL will be used instead. |
|
Specifies how many seconds RADKit will wait before failing task. Note that the request is not affected, and it will still eventually complete (successfully or unsuccessfully) Can optionally set via environemnt variable RADKIT_ANSIBLE_WAIT_TIMEOUT Default: |
Examples
- name: Get parsed output from rtr-csr1 with removed return keys
cisco.radkit.genie_learn:
device_name: rtr-csr1
models: platform
os: iosxe
remove_model_and_device_keys: yes
register: cmd_output
delegate_to: localhost
- name: Show Chassis Serial Number
debug:
msg: "{{ cmd_output['genie_learn_result']['chassis_sn'] }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dictionary of results is returned if running command on multiple devices or with multiple models Returned: success |
|
Command Returned: success |
|
Device in Radkit Returned: success |
|
Status of exec from RADKit Returned: success |
|
Status message from RADKit Returned: success |
|
Dictionary of parsed results Returned: success |