cv_facts
cv_facts¶
Collect facts from CloudVision Portal.
Module added in version 1.0.0
Synopsis¶
Returns list of devices, configlets, containers and images
Module-specific Options¶
The following options may be specified for this module:
parameter | type | required | default | choices | comments |
---|---|---|---|---|---|
gather_subset | list | False | [‘default’] |
|
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. |
facts | list | False | [‘all’] |
|
List of facts to retrieve from CVP. By default, cv_facts returns facts for devices, configlets, containers, and tasks. Using this parameter allows user to limit scope to a subset of information. |
Examples¶
---
tasks:
- name: '#01 - Collect devices facts from {{inventory_hostname}}'
cv_facts:
facts:
devices
register: FACTS_DEVICES
- name: '#02 - Collect devices facts (with config) from {{inventory_hostname}}'
cv_facts:
gather_subset:
config
facts:
devices
register: FACTS_DEVICES_CONFIG
- name: '#03 - Collect confilgets facts from {{inventory_hostname}}'
cv_facts:
facts:
configlets
register: FACTS_CONFIGLETS
- name: '#04 - Collect containers facts from {{inventory_hostname}}'
cv_facts:
facts:
containers
register: FACTS_CONTAINERS
- name: '#10 - Collect ALL facts from {{inventory_hostname}}'
cv_facts:
register: FACTS
For a complete list of examples, check them out on our GitHub repository.
Module output¶
Example output
ansible_facts:
cvp_info:
editable: 2023.1.1
configlets:
- name: ANSIBLE_TESTING_CONTAINER
isDefault: 'no'
config: alias a57 show version
reconciled: false
netElementCount: 3
editable: true
dateTimeInLongFormat: 1574944821353
isDraft: false
note: '## Managed by Ansible ##'
visible: true
containerCount: 2
user: cvpadmin
key: configlet_3503_4572477104617871
sslConfig: false
devices:
- veos01
- veos03
...
Author¶
Ansible Arista Team (@aristanetworks)
Last update:
November 21, 2023