community.network.sros_command – Run commands on remote devices running Nokia SR OS¶
Note
This plugin is part of the community.network collection (version 1.3.2).
To install it use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.sros_command
.
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 community.network.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
community.network.sros_command:
commands: show version
provider: "{{ cli }}"
- name: Run show version and check to see if output contains sros
community.network.sros_command:
commands: show version
wait_for: result[0] contains sros
provider: "{{ cli }}"
- name: Run multiple commands on remote nodes
community.network.sros_command:
commands:
- show version
- show port detail
provider: "{{ cli }}"
- name: Run multiple commands and evaluate the output
community.network.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:
Authors¶
Peter Sprygada (@privateip)