arista / arista.cvp / 1.1.0 / module / cv_device Provision, Reset, or Update CloudVision Portal Devices. | "added in version" 2.9 of arista.cvp" Authors: EMEA AS Team (@aristanetworks) preview | supported by communityarista.cvp.cv_device (1.1.0) — module
Install with ansible-galaxy collection install arista.cvp:==1.1.0
collections: - name: arista.cvp version: 1.1.0
CloudVison Portal Device compares the list of Devices in
in devices against cvp-facts then adds, resets, or updates them as appropriate.
If a device is in cvp_facts but not in devices it will be reset to factory defaults
If a device is in devices but not in cvp_facts it will be provisioned
If a device is in both devices and cvp_facts its configlets and imageBundles will be compared
and updated with the version in devices if the two are different.
--- - name: Test cv_device hosts: cvp connection: local gather_facts: no collections: - arista.cvp vars: configlet_list: cv_device_test01: "alias a{{ 999 | random }} show version" cv_device_test02: "alias a{{ 999 | random }} show version" # Device inventory for provision activity: bind configlet devices_inventory: veos01: name: veos01 configlets: - cv_device_test01 - SYS_TelemetryBuilderV2_172.23.0.2_1 - veos01-basic-configuration - SYS_TelemetryBuilderV2 tasks: # Collect CVP Facts as init process - name: "Gather CVP facts from {{inventory_hostname}}" cv_facts: register: cvp_facts tags: - always - name: "Configure devices on {{inventory_hostname}}" tags: - provision cv_device: devices: "{{devices_inventory}}" cvp_facts: '{{cvp_facts.ansible_facts}}' device_filter: ['veos'] register: cvp_device - name: "Add configlet to device on {{inventory_hostname}}" tags: - provision cv_device: devices: "{{devices_inventory}}" cvp_facts: '{{cvp_facts.ansible_facts}}' configlet_mode: merge device_filter: ['veos'] register: cvp_device
state: choices: - present - absent default: present description: - If absent, devices will be removed from CVP and moved back to undefined. - If present, devices will be configured or updated. required: false type: str devices: description: Yaml dictionary to describe intended devices configuration from CVP stand point. required: true type: dict cvp_facts: description: Facts from CVP collected by cv_facts module required: true type: dict device_filter: default: - all description: Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. device_filter list devices that can be modified or deleted based on configlets entries. required: false type: list configlet_mode: choices: - override - merge - delete default: override description: - If override, Add listed configlets and remove all unlisted ones. - If merge, Add listed configlets to device and do not touch already configured configlets. required: false type: str