The gather
role enables users to collect and display structured facts for provided network resources. This role helps administrators gain insights into the current state of network configurations in a standardized format.
- Retrieve structured facts for specified network resources.
- Support for various network resources like
ospfv2
,ospfv3
,ospf_interfaces
, etc. - Provides data in YAML format for easy consumption and analysis.
Variable Name | Default Value | Required | Type | Description | Example |
---|---|---|---|---|---|
ansible_network_os |
"" |
no | str | Network OS to be used during gather. | "cisco.nxos.nxos" |
Below is an example playbook demonstrating how to use the gather
role, where we will retrieve facts for the specified network resources:
---
- name: Gather structured facts for network resources
hosts: all
gather_facts: true
tasks:
- name: Invoke gather role
ansible.builtin.include_role:
name: network.ospf.gather
vars:
ansible_network_os: cisco.nxos.nxos
Example Output When the playbook is executed successfully, the output will display the structured facts for the specified resources.
GNU General Public License v3.0 or later. See LICENSE to see the full text.
- Ansible Network Content Team