Skip to content

cv\_configlet

cv_configlet

Create, Delete, or Update CloudVision Portal Configlets.

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
configlet_filter
list no ['none']
Filter to apply intended mode on a set of configlet. If not used, then module only uses ADD mode. configlet_filter list configlets that can be modified or deleted based on configlets entries.
configlets
dict yes
List of configlets to managed on CVP server.
configlets_notes
str no Managed by Ansible
Add a note to the configlets.
cvp_facts
dict yes
Facts extracted from CVP servers using cv_facts module
filter_mode
str no loose
  • loose
  • strict
If loose, a match is when a configlet matches a substring of a configlet defined in the filter
If strict, a match is when a configlet exactly matches a configlet defined in the filter
state
str no present
  • present
  • absent
If absent, configlets will be removed from CVP if they are not bound to either a container or a device.
If present, configlets will be created or updated.


Examples:

---
- name: Test cv_configlet_v2
  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: 'Collecting facts from CVP {{inventory_hostname}}.'
      tags:
        - always
      cv_facts:
      register: cvp_facts

    - name: 'Create configlets on CVP {{inventory_hostname}}.'
      tags:
        - provision
      cv_configlet:
        cvp_facts: "{{cvp_facts.ansible_facts}}"
        configlets: "{{configlet_list}}"
        configlets_notes: "Configlet managed by Ansible"
        configlet_filter: ["New", "Test","base-chk","base-firewall"]
      register: cvp_configlet
Author

- EMEA AS Team (@aristanetworks)


Last update: April 28, 2021


Back to top