Note
This plugin is part of the community.network collection.
To install it use: ansible-galaxy collection install community.network.
To use it in a playbook, specify: community.network.ce_facts.
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.| Parameter | Choices/Defaults | Comments |
|---|---|---|
| gather_subset string | Default: "!config" | When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, hardware, config, and interfaces. Can specify a list of values to include a larger subset. Values can also be used with an initial ! to specify that a specific subset should not be collected. |
Note
network_cli.local connections for legacy playbooks.# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
- name: CloudEngine facts test
hosts: cloudengine
connection: local
gather_facts: no
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Gather_subset is all"
community.network.ce_facts:
gather_subset: all
provider: "{{ cli }}"
- name: "Collect only the config facts"
community.network.ce_facts:
gather_subset: config
provider: "{{ cli }}"
- name: "Do not collect hardware facts"
community.network.ce_facts:
gather_subset: "!hardware"
provider: "{{ cli }}"
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| all_ipv4_addresses list / elements=string | when interfaces is configured | All IPv4 addresses configured on the device |
| BIOS Version string | always | The BIOS version running on the remote device |
| Board Type string | always | The board type of the remote device |
| config string | when config is configured | The current system configuration on the device |
| CPLD1 Version string | always | The CPLD1 Version running the remote device |
| CPLD2 Version string | always | The CPLD2 Version running the remote device |
| FAN string | when hardware is configured | The fan state on the device |
| filesystems string | when hardware is configured | The filesystems on the device |
| flash_free string | when hardware is configured | The flash free space on the device |
| flash_total string | when hardware is configured | The flash total space on the device |
| gather_subset list / elements=string | always | The list of fact subsets collected from the device |
| hostname string | always | The hostname of the remote device |
| interfaces dictionary | when interfaces is configured | A hash of all interfaces running on the system |
| MAB Version string | always | The MAB Version running the remote device |
| memory_free string | when hardware is configured | The memory free space on the remote device |
| memory_total string | when hardware is configured | The memory total space on the remote device |
| neighbors dictionary | when interfaces is configured | The list of LLDP neighbors from the remote device |
| PCB Version string | always | The PCB Version running the remote device |
| PWR string | when hardware is configured | The power state on the device |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/network/ce_facts_module.html