Basic commands to test ansible with a basic installation
1. Collect facts from CloudVision
# Move to lab directory
$ cd ../lab03-arista.cvp-overview
# Display module documentation
$ ansible-doc arista.cvp.cv_device
# Run playbook to collect CVP facts
$ ansible-playbook playbook.facts.yml
3. Optional: Collect only facts for devices
Get and display facts of active devices with their configuration
---
- name: lab03 - cv_facts lab
hosts: CloudVision
connection: local
gather_facts: no
tasks:
- name: "Gather CVP facts {{inventory_hostname}}"
arista.cvp.cv_facts:
facts:
devices
gather_subset:
config
register: cv_facts
- name: "Print out facts from {{inventory_hostname}}"
debug:
msg: "{{cv_facts}}"