Skip to content

cv_tag_v3

cv_tag_v3

Create/Assign/Delete/Unassign tags on CVP

Module added in version 3.4.0

Synopsis

CloudVision Portal Tag module to Create/Assign/Delete/Unassign tags on CloudVision

Module-specific Options

The following options may be specified for this module:

parameter type required default choices comments
auto_create
bool no True
  • yes
  • no
auto_create tags before assigning
mode
str no
  • create
  • delete
  • assign
  • unassign
action to carry out on the tags create - create tags delete - delete tags assign - assign existing tags to device unassign - unassign existing tags from device
tags
list yes
CVP tags


Examples:

# Create and assign device and interface tags to multiple devices and interfaces
- name: cv_tag_v3 example1
  hosts: cv_server
  connection: local
  gather_facts: no
  vars:
    CVP_TAGS:
      - device: leaf1
        device_tags:
          - name: tag1
            value: value1
          - name: tag2
            value: value2
          - name: tag3
            value: value3
        interface_tags:
          - interface: Ethernet1
            tags:
              - name: tag1i
                value: value1i
              - name: tag2i
                value: value2i
          - interface: Ethernet2
            tags:
              - name: tag1i
                value: value1i
              - name: tag2i
                value: value2i
      - device: spine1
        device_tags:
          - name: DC
            value: Dublin
          - name: rack
            value: rackA
          - name: pod
            value: podA
        interface_tags:
          - interface: Ethernet3
            tags:
              - name: tag3i
                value: value3i
              - name: tag4i
                value: value4i
          - interface: Ethernet4
            tags:
              - name: tag5i
                value: value6i
              - name: tag6i
                value: value6i
  tasks:
    - name: "create tags"
      arista.cvp.cv_tag_v3:
        tags: "{{CVP_TAGS}}"
        mode: assign
        auto_create: true

# Delete device and interface tags
- name: cv_tag_v3 example2
  hosts: cv_server
  connection: local
  gather_facts: no
  vars:
    CVP_TAGS:
      - device: leaf1
        device_tags:
          - name: tag1
            value: value1
        interface_tags:
          - interface: Ethernet1
            tags:
              - name: tag1i
                value: value1i
  tasks:
    - name: "create tags"
      arista.cvp.cv_tag_v3:
        tags: "{{CVP_TAGS}}"
        mode: delete

# Create device and interface tags (without assigning to the devices)
- name: cv_tag_v3 example3
  hosts: cv_server
  connection: local
  gather_facts: no
  vars:
    CVP_TAGS:
      - device: leaf1
        device_tags:
          - name: tag1
            value: value1
        interface_tags:
          - interface: Ethernet1
            tags:
              - name: tag1i
                value: value1i
  tasks:
    - name: "create tags"
      arista.cvp.cv_tag_v3:
        tags: "{{CVP_TAGS}}"
        mode: create

# Assign device and interface tags
- name: cv_tag_v3 example4
  hosts: cv_server
  connection: local
  gather_facts: no
  vars:
    CVP_TAGS:
      - device: leaf1
        device_tags:
          - name: tag1
            value: value1
        interface_tags:
          - interface: Ethernet1
            tags:
              - name: tag1i
                value: value1i
  tasks:
    - name: "create tags"
      arista.cvp.cv_tag_v3:
        tags: "{{CVP_TAGS}}"
        mode: assign

# Unassign device and interface tags
- name: cv_tag_v3 example5
  hosts: cv_server
  connection: local
  gather_facts: no
  vars:
    CVP_TAGS:
      - device: leaf1
        device_tags:
          - name: tag1
            value: value1
        interface_tags:
          - interface: Ethernet1
            tags:
              - name: tag1i
                value: value1i
  tasks:
    - name: "create tags"
      arista.cvp.cv_tag_v3:
        tags: "{{CVP_TAGS}}"
        mode: assign
Author
  • Ansible Arista Team (@aristanetworks)
Full Schema

Get full schema docs here.


Last update: October 27, 2022