Skip to content

cv_configlet_v3

cv_configlet_v3

Create, Delete, or Update CloudVision Portal Configlets.

Module added in version 3.0.0

Synopsis

CloudVison Portal Configlet compares the list of configlets and config in configlets against cvp-facts then adds, deletes, or updates them as appropriate. If a configlet is in cvp_facts but not in configlets it will be deleted. If a configlet is in configlets but not in cvp_facts it will be created. If a configlet is in both configlets and cvp_facts it configuration will be compared and updated with the version in configlets if the two are different.

Module-specific Options

The following options may be specified for this module:

parameter type required default choices comments
configlets dict True List of configlets to managed on CVP server.
configlets_notes str False Managed by Ansible Add a note to the configlets.
state str False present
  • present
  • absent
  • If absent, configlets will be removed from CVP if not bound to a container or a device.
  • If present, configlets will be created or updated.

Examples

---
- name: Test cv_configlet_v3
  hosts: cvp
  connection: local
  gather_facts: no
  vars:
    configlet_list:
      Test_Configlet: "! This is a Very First Testing Configlet\n!"
      Test_DYNAMIC_Configlet: "{{ lookup('file', 'templates/configlet_'+inventory_hostname+'.txt') }}"
  tasks:
    - name: "Push config"
      arista.cvp.cv_configlet_v3:
        configlets: "{{configlet_list}}"
        state: present
      register: cvp_configlet

For a complete list of examples, check them out on our GitHub repository.

Module output

Example output
msg:
  changed: true
  configlets_created:
    changed: false
    configlets_created_count: 0
    configlets_created_list: []
    diff: {}
    success: false
    taskIds: []
  configlets_deleted:
    changed: false
    configlets_deleted_count: 0
    configlets_deleted_list: []
    diff: {}
    success: false
    taskIds: []
  configlets_updated:
    changed: true
    configlets_updated_count: 2
    configlets_updated_list:
    - 01TRAINING-alias
    - 01TRAINING-01
    diff:
      01TRAINING-alias:
      - 0.9565217391304348
      - - |-
          --- CVP
        - |-
          +++ Ansible
        - |-
          @@ -1 +1 @@
        - -alias a101 show version
        - +alias a103 show version
    success: true
    taskIds:
    - '460'
  failed: false
  success: true
  taskIds:
  - '460'

Author

Ansible Arista Team (@aristanetworks)


Last update: November 21, 2023