sros_command – Run commands on remote devices running Nokia SR OS¶
Synopsis¶
Sends arbitrary commands to an SR OS node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
This module does not support running commands in configuration mode. Please use sros_config to configure SR OS devices.
Parameters¶
Notes¶
Note
For more information on using Ansible to manage Nokia SR OS Network devices see https://www.ansible.com/ansible-nokia.
Examples¶
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
---
vars:
cli:
host: "{{ inventory_hostname }}"
username: admin
password: admin
transport: cli
---
tasks:
- name: run show version on remote devices
sros_command:
commands: show version
provider: "{{ cli }}"
- name: run show version and check to see if output contains sros
sros_command:
commands: show version
wait_for: result[0] contains sros
provider: "{{ cli }}"
- name: run multiple commands on remote nodes
sros_command:
commands:
- show version
- show port detail
provider: "{{ cli }}"
- name: run multiple commands and evaluate the output
sros_command:
commands:
- show version
- show port detail
wait_for:
- result[0] contains TiMOS-B-14.0.R4
provider: "{{ cli }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by an Ansible Partner. [certified]
Authors¶
Peter Sprygada (@privateip)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.