Skip to content

cv_workflow

Note

Always use the FQCN (Fully Qualified Collection Name) arista.avd.cv_workflow when using this plugin.

Deploy various objects to CloudVision

Synopsis

The arista.avd.cv_workflow module is an Ansible Action Plugin providing the following capabilities:

  • Verify Devices are in the CloudVision inventory.
  • Verify Devices are in the Inventory & Topology Studio.
  • Update the Device hostname in the Inventory & Topology Studio as needed.
  • Create Workspace and build, submit, abandon as needed.
  • Deploy device-specific EOS configurations using Static Configuration Studio.
  • Deploy a full hierarchy of containers and configlets using Static Configuration Studio.
  • Create and associate Device and Interface Tags.
  • Approve, run, cancel Change Controls as needed.

Parameters

Argument Type Required Default Value Restrictions Description
cv_servers list True None - List of hostnames or IP addresses for CloudVision instance to deploy to.
cv_token str False None - Service account token. It is strongly recommended to use Vault for this.
cv_username str False None - Username to use if cv_token is missing. Not supported for CVaaS.
cv_password str False None - Password to use if cv_token is missing. Not supported for CVaaS. It is strongly recommended to use Vault for this.
cv_verify_certs bool optional True - Verifies CloudVison server certificates.
proxy_host str False None - FQDN/IP of the HTTP CONNECT proxy server.
proxy_port int optional 8080 - TCP port of the HTTP CONNECT proxy server.
proxy_username str False None - Authentication username for the HTTP CONNECT proxy server.
proxy_password str False None - Authentication password for the HTTP CONNECT proxy server. It is strongly recommended to use Vault for this.
configuration_dir str True None - Path to directory containing .cfg files with EOS configurations.
structured_config_dir str False None - Path to directory containing files with AVD structured configurations.
If found, the serial_number or system_mac_address will be used to identify the Device on CloudVision.
Any tags found in the structured configuration metadata will be applied to the Device and/or Interfaces.
structured_config_suffix str optional yml - File suffix for AVD structured configuration files.
device_list list False None - List of devices to deploy. The names are used to find AVD structured configuration and EOS configuration files.
strict_tags bool optional False - If true other tags associated with the devices will get removed. Otherwise other tags will be left as-is.
skip_missing_devices bool optional False - If true anything that can be deployed will get deployed. Otherwise the Workspace will be abandoned on any issue.
strict_system_mac_address bool optional False - If true, raise an exception if the input data contains devices with a duplicated system_mac_address but unique serial_number values.
Otherwise, just issue a warning.
configlet_name_template str optional AVD-${hostname} - Python String Template to use for creating the configlet name for each device configuration.
static_config_manifest dict optional None - Deploy a manifest of containers and configlets to CloudVision using the Static Configuration Studio.
    configlets list optional None - A list of dictionaries defining configlets to be pushed to the Configlet Library.

Each dictionary in the list must follow this data model:
- name (str, required): Unique name for the configlet.
- file (str, required): Filesystem path to the text file containing the configlet body. Relative to the current working directory.
    containers list optional None - A list of dictionaries defining the root containers in the hierarchy.

Each dictionary in the list must follow this data model:
- name (str, required): Name for the container. Sibling containers must have unique names.
- tag_query (str, required): A query string used to match devices based on their assigned tags.
- description (str, optional): An optional description for the container.
- match_policy (str, optional, default: "match_all"): The match policy to determine how devices with a matching tag inherit
a child container configlets. Valid choices are match_all or match_first.
- configlets (list of str, optional): A list of configlet names to apply to this container. Must be defined in the configlets section.
- sub_containers (list of dict, optional): A nested list of container dictionaries that follow this same data model,
allowing for a full hierarchy.
workspace dict optional None - CloudVision Workspace to create or use for the deployment.
    name str optional None - Optional name to use for the created Workspace. By default the name will be AVD <timestamp>.
    description str optional None - Optional description to use for the created Workspace.
    id str optional None - Optional ID to use for the created Workspace. If there is already a workspace with the same ID, it must be in the 'pending' state.
    requested_state str optional built Valid values:
- pending
- built
- submitted
- abandoned
- deleted
The requested state for the Workspace.

- pending: Leave the Workspace in pending state.
- built: Build the Workspace but do not submit.
- submitted (default): Build and submit the Workspace.
- abandoned: Build and then abandon the Workspace.
Used for dry-run where no changes will be committed to CloudVision.
- deleted: Build, abort and then delete the Workspace.
Used for dry-run where no changes will be committed to CloudVision and the temporary Workspace will be removed to avoid "clutter".
    force bool optional False - Force submit the workspace even if some devices are not actively streaming to CloudVision.
change_control dict optional None - CloudVision Change Control to create for the deployment.
    name str optional None - Optional name to use for the created Change Control. By default the name generated by CloudVision will be kept.
    description str optional None - Optional description to use for the created Change Control.
    requested_state str optional pending approval Valid values:
- pending approval
- approved
- running
- completed
The requested state for the Change Control.

- pending approval (default): Leave the Change Control in "pending approval" state.
- approved: Approve the Change Control but do not start.
- running: Approve and start the Change Control. Do not wait for the Change Control to be completed or failed.
- completed: Approve and start the Change Control. Wait for the Change Control to be completed.
timeouts dict optional None - Timeouts for long running operations. May need to be adjusted for large inventories.
    workspace_build_timeout float optional 300.0 - Time to wait for Workspace build before failing.
    change_control_creation_timeout float optional 300.0 - Time to wait for Change Control creation before failing.
return_details bool optional False - If true all details will be returned to Ansible and can be registered.
For large inventories this can affect performance, so it is disabled by default.

Notes

  • When interacting with CVaaS the regional URL where the tenant is deployed should be used, e.g: cv_servers: [ www.cv-prod-euwest-2.arista.io ] To see the full list of regional URLs, please visit the cv_deploy role documentation.
  • To generate service accounts check cv_deploy role documentation or the CloudVision Help Center.

Examples

---
- name: Configuration deployment with CVP
  hosts: FABRIC
  connection: local
  gather_facts: false
  tasks:
    - name: Provision CVP with AVD configuration
      run_once: true
      delegate_to: localhost
      arista.avd.cv_workflow:
        cv_servers: [ "www.arista.io" ]
        cv_token: "<insert vaulted service account token here>"
        # cv_verify_certs: true
        # proxy_host: "proxy.local.domain"
        # proxy_port: "8080"
        # proxy_username: "avd_user"
        # proxy_password: "avd_password"
        configuration_dir: "{{ inventory_dir }}/intended/configs"
        structured_config_dir: "{{ inventory_dir }}/intended/structured_configs"
        # structured_config_suffix: "yml"
        device_list: "{{ ansible_play_hosts }}"
        # strict_tags: false
        # skip_missing_devices: false
        # strict_system_mac_address: false
        # configlet_name_template: "AVD-${hostname}"
        # static_config_manifest:
        #   configlets:
        #     - name: "GLOBAL_NTP_SERVERS"
        #       file: "configlets/global_ntp.txt"
        #     - name: "CORP_BANNER"
        #       file: "configlets/corp_banner.txt"
        #   containers:
        #     - name: "Global"
        #       tag_query: "device:*"
        #       match_policy: "match_all"
        #       configlets:
        #         - name: "GLOBAL_NTP_SERVERS"
        #       sub_containers:
        #         - name: "Data Centers"
        #           tag_query: "topology_network_type:datacenter"
        #           configlets:
        #             - name: "CORP_BANNER"
        workspace:
        #   name:
        #   description:
        #   id: <uuid or similar>
          requested_state: submitted
          force: true
        change_control:
        #   name:
        #   description:
          requested_state: "approved"
        # timeouts:
        #   workspace_build_timeout: 300.0
        #   change_control_creation_timeout: 300.0
        # return_details: false

Authors

  • Arista Ansible Team (@aristanetworks)