Last active
December 14, 2020 04:35
-
-
Save ganeshrn/f763e299cb4896b548c586b57041ee73 to your computer and use it in GitHub Desktop.
Get interface state in structured format on nxos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: nxos | |
connection: ansible.netcommon.network_cli | |
gather_facts: false | |
vars: | |
ansible_network_os: cisco.nxos.nxos | |
ansible_user: "changeme" | |
ansible_password: "changeme" | |
tasks: | |
- name: "Fetch interface state and parse with pyats" | |
ansible.utils.cli_parse: | |
command: show interface | |
parser: | |
name: ansible.netcommon.pyats | |
register: nxos_pyats_show_interface | |
- name: print structured interface state data | |
ansible.builtin.debug: | |
msg: "{{ nxos_pyats_show_interface['parsed'] }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment