A very simple examples for collecting data from Cisco Nexus devices using ansible.
- ansible collection: cisco.nxos
-
Edit inventory file
[nexus] n3k1 ansible_host=CHANGE_ME ansible_user=CHANGE_ME ansible_password=CHANGE_ME n3k2 ansible_host=CHANGE_ME ansible_user=CHANGE_ME ansible_password=CHANGE_ME [nexus:vars] ansible_connection=ansible.netcommon.network_cli ansible_network_os=cisco.nxos.nxos
-
Run playbook
ansible-playbook -i hosts version.yml ansible-playbook -i hosts interface.yml
-
As a result, 2 files are created.
- version.json
- interfaces.csv