insobi / ansible_nxos_example

A simple examples for collecting data from Cisco Nexus devices using ansible.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible NXOS Example

A very simple examples for collecting data from Cisco Nexus devices using ansible.

overview



Prerequisite

  • ansible collection: cisco.nxos



How to run

  1. 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
    
  2. Run playbook

    ansible-playbook -i hosts version.yml
    ansible-playbook -i hosts interface.yml
    
    
  3. As a result, 2 files are created.

    • version.json

    result

    • interfaces.csv

    result


References

About

A simple examples for collecting data from Cisco Nexus devices using ansible.