arista.cvp.cv_change_control_v3 (3.10.1) — module

Change Control management with CloudVision

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

Authors: Ansible Arista Team (@aristanetworks)

Install collection

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


Add to requirements.yml

  collections:
    - name: arista.cvp
      version: 3.10.1

Description

CloudVision Portal change control module.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: CVP Change Control Tests
  hosts: cv_server
  gather_facts: no
  vars:
    ansible_command_timeout: 1200
    ansible_connect_timeout: 600
    change:
      name: Ansible playbook test change
      notes: Created via playbook
      activities:
        - action: "Switch Healthcheck"
          name: Switch1_healthcheck
          arguments:
            - name: DeviceID
              value: <device serial number>
          stage: Pre-Checks
        - action: "Switch Healthcheck"
          name: Switch2_healthcheck
          arguments:
            - name: DeviceID
              value: <device serial number>
          stage: Pre-Checks
        - task_id: "20"
          stage: Leaf1a_upgrade
        - task_id: "22"
          stage: Leaf1b_upgrade
      stages:
        - name: Pre-Checks
          mode: parallel
        - name: Upgrades
          modes: series
        - name: Leaf1a_upgrade
          parent: Upgrades
        - name: Leaf1b_upgrade
          parent: Upgrades

  tasks:
    - name: "Gather CVP change controls {{inventory_hostname}}"
      arista.cvp.cv_change_control_v3:
        state: show
      register: cv_facts

    - name: "Print out all change controls from {{inventory_hostname}}"
      debug:
        msg: "{{cv_facts}}"


    - name: "Check CC structure"
      debug:
        msg: "{{change}}"


    - name: "Create a change control on {{inventory_hostname}}"
      arista.cvp.cv_change_control_v3:
        state: set
        change: "{{ change }}"
      register: cv_change_control

    - name: "Get the created change control {{inventory_hostname}}"
      arista.cvp.cv_change_control_v3:
        state: show
        name: change.name
      register: cv_facts

    - name: "Show the created CC from {{inventory_hostname}}"
      debug:
        msg: "{{cv_facts}}"


    - name: "Delete the CC from {{inventory_hostname}}"
      arista.cvp.cv_change_control_v3:
        state: remove
        name: "{{change.name}}"
      register: cv_deleted

    - name: "Show deleted CCs"
      debug:
        msg: "{{cv_deleted}}"

    - name: "Approve a change control on {{inventory_hostname}}"
      arista.cvp.cv_change_control_v3:
        state: approve
        change_id: ["{{ cv_change_control.data.id }}"]

    - name: "Execute a change control on {{inventory_hostname}}"
      arista.cvp.cv_change_control_v3:
        state: execute
        change_id: ["{{ cv_change_control.data.id }}"]

Inputs

    
name:
    description: The name of the change control. If not provided, one will be generated
      automatically.
    required: false
    type: str

state:
    choices:
    - show
    - set
    - remove
    - approve
    - unapprove
    - execute
    - schedule
    - approve_and_execute
    - schedule_and_approve
    default: show
    description: Set if we should get, set/update, or remove the change control.
    required: false
    type: str

change:
    description: A dictionary containing the change control to be created/modified.
    required: false
    type: dict

change_id:
    description: List of change IDs to get/remove.
    elements: str
    required: false
    type: list

schedule_time:
    description: RFC3339 time format, e.g., `2021-12-23T02:07:00.0`.
    required: false
    type: str