Module to collect facts from remote devices.
Version added: 1.0.0
- Collects a base set of device facts from a remote device that is running IOS. This module prepends all of the base network fact keys with
ansible_net_<fact>
. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
Note
- Tested against Cisco IOSXE Version 17.3 on CML and IOS 15.6 for L2 specific resource.
- Facts gathering for L3 devices are supposed to produce blank output for unsupported resources like vlan.
- This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
- For more information on using Ansible to manage Cisco devices see the Cisco integration page.
- name: Gather all legacy facts
cisco.ios.ios_facts:
gather_subset: all
- name: Gather only the config and default facts
cisco.ios.ios_facts:
gather_subset:
- config
- name: Do not gather hardware facts
cisco.ios.ios_facts:
gather_subset:
- "!hardware"
- name: Gather legacy and resource facts
cisco.ios.ios_facts:
gather_subset: all
gather_network_resources: all
- name: Gather only the interfaces resource facts and no legacy facts
cisco.ios.ios_facts:
gather_subset:
- "!all"
- "!min"
gather_network_resources:
- interfaces
- name: Gather interfaces resource and minimal legacy facts
cisco.ios.ios_facts:
gather_subset: min
gather_network_resources: interfaces
- name: Gather L2 interfaces resource and minimal legacy facts
cisco.ios.ios_facts:
gather_subset: min
gather_network_resources: l2_interfaces
- name: Gather L3 interfaces resource and minimal legacy facts
cisco.ios.ios_facts:
gather_subset: min
gather_network_resources: l3_interfaces
Common return values are documented here, the following are the fields unique to this module:
- Peter Sprygada (@privateip)
- Sumit Jaiswal (@justjais)