Skip to content

Instantly share code, notes, and snippets.

@NilashishC
Last active January 17, 2024 11:02
Show Gist options
  • Save NilashishC/fb0f9bb31b665758451eef6e413d56af to your computer and use it in GitHub Desktop.
Save NilashishC/fb0f9bb31b665758451eef6e413d56af to your computer and use it in GitHub Desktop.
Playbook:
=============
---
- hosts: nxos
gather_facts: True
gather_subset: interfaces
module_defaults:
cisco.nxos.nxos_facts:
gather_network_resources: interfaces
NOTE:
1. The output has `net_interfaces` which is coming from `gather_facts: true` + `gather_subset: interfaces`.
2. The other `net_` keys come from the implicit `gather_subset: min` which is the default anyway.
Output:
=============
ok: [nxos-10-3-1] =>
ansible_facts:
net_all_ipv4_addresses:
- 192.168.255.147
net_all_ipv6_addresses:
- fd5d:12c9:2201:2::1/64
net_api: cliconf
net_gather_network_resources: []
net_gather_subset:
- default
- interfaces
net_hostname: nexus9300-10-3-1
net_image: bootflash:///nxos64-cs.10.3.1.F.bin
net_interfaces:
Ethernet1/1:
bandwidth: '10000000'
duplex: auto
macaddress: 5200.46bb.1b08
mtu: '1500'
speed: auto-speed
state: down
type: 100/1000/10000 Ethernet
Ethernet1/10:
bandwidth: '10000000'
duplex: auto
macaddress: 5200.46bb.1b08
mtu: '1500'
speed: auto-speed
state: down
type: 100/1000/10000 Ethernet
Ethernet1/11:
bandwidth: '10000000'
duplex: auto
macaddress: 5200.46bb.1b08
mtu: '1500'
speed: auto-speed
state: down
type: 100/1000/10000 Ethernet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment