arista.cvp.cv_configlet_v1 (1.1.0) — module

Create, Delete, or Update CloudVision Portal Configlets.

| "added in version" 2.9 of arista.cvp"

Authors: EMEA AS Team (@aristanetworks)

preview | supported by community

Install collection

Install with ansible-galaxy collection install arista.cvp:==1.1.0


Add to requirements.yml

  collections:
    - name: arista.cvp
      version: 1.1.0

Description

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.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- 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}}"
        configlet_filter: ["New", "Test","base-chk","base-firewall"]
      register: cvp_configlet

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - 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.
    required: false
    type: str

cvp_facts:
    description: Facts extracted from CVP servers using cv_facts module
    required: true
    type: dict

configlets:
    description: List of configlets to managed on CVP server.
    required: true
    type: dict

configlet_filter:
    default:
    - none
    description: 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.
    required: false
    type: list