community.network.cnos_showrun – Collect the current running configuration on devices running on CNOS¶
Note
This plugin is part of the community.network collection (version 2.1.1).
To install it use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.cnos_showrun
.
Synopsis¶
This module allows you to view the switch running configuration. It executes the display running-config CLI command on a switch and returns a file containing the current running configuration of the target network device. This module uses SSH to manage network device configuration. The results of the operation will be placed in a directory named ‘results’ that must be created by the user in their local directory to where the playbook is run.
Parameters¶
Notes¶
Note
For more information on using Ansible to manage Lenovo Network devices see https://www.ansible.com/ansible-lenovo.
Examples¶
Tasks : The following are examples of using the module cnos_showrun. These are
written in the main.yml file of the tasks directory.
---
- name: Run show running-config
community.network.cnos_showrun:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_showrun_{{ inventory_hostname }}_output.txt"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
msg
string
|
always |
Success or failure message
Sample:
Running Configuration saved in file
|
Authors¶
Anil Kumar Muraleedharan (@amuraleedhar)