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 EOS configurations using "Static Configlet 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 | True | None | Service account token. It is strongly recommended to use Vault for this. | |
cv_verify_certs | bool | optional | True | Verifies CloudVison server certificates. | |
configuration_dir | str | True | None | Path to directory containing .cfg files with EOS configurations. | |
structured_config_dir | str | True | 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 | True | 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. |
|
configlet_name_template | str | optional | AVD-${hostname} | Python String Template to use for creating the configlet name for each device configuration. | |
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. |
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
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
# configlet_name_template: "AVD-${hostname}"
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)