arista / arista.cvp / 3.10.1 / module / cv_device
Removed in 4.0.0
Reason:Updated modules released with increased functionality | Alternative:Use M(arista.cvp.cv_device_v3) instead.
Provision, Reset, or Update CloudVision Portal Devices.
| "added in version" 1.0.0 of arista.cvp"
Authors: Ansible Arista Team (@aristanetworks)
Install with ansible-galaxy collection install arista.cvp:==3.10.1
collections: - name: arista.cvp version: 3.10.1
CloudVision Portal Device compares the list of Devices
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 in ZTP mode
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.
Warning - reset means devices will be erased and will run full ZTP process. Use this function with caution !
--- - 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 parentContainername: 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 options: description: Implements the ability to create a sub-argument_spec, where the sub options of the top level argument are also validated using the attributes discussed in this section. required: false 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. elements: str 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