Closed batchenr closed 3 years ago
Hello @batchenr
To get device information using cv_facts
, you should use this type of playbook: here we just print out FQDN field but you can adapt.
---
- name: cv_configlet unit testing
hosts: cv_server
connection: local
gather_facts: false
tasks:
- name: Get CV Facts
arista.cvp.cv_facts:
facts:
devices
register: cv_facts
- name: "Print out facts from CVP"
debug:
msg: "{{item.fqdn}}"
when:
- item.fqdn == 'DC1-L2LEAF1A.eve.emea.lab'
loop: "{{cv_facts.ansible_facts.devices}}"
Note that cv_fact
get information from Cloudvision and does not provide more information than what is provided by inventory/devices
API call.
Besides that, if you want to configure configlets and container even for a specific device, you need to collect all facts to let ansible find mandatory information to send correct information to CV.
Hey I have been trying to run a playbook that shows specific information on a device, but none of the examples work for me and it ends up giving me all the information from all devices.
Containers by order of connection: Tenant -> HQ -> HQ-Users -> HQ-Users-Floors -> the device dw-k3-01 the specific device i want to test is : dw-k3-01 Device configlets name: dw-k3-01 (device and configrlet has the same name.
This is the playbooks i ran:
also this playbook :
This will sort the information much better but still i will have to parse ansible output, if there is a ways without filtering ansible output i would rather do that.
Packages:
How to get the specific device facts only ?