Skip to content

Home

Ansible Modules for Arista CloudVision Platform

About

Arista Networks supports Ansible for managing devices running the EOS operating system through CloudVision platform (CVP). This collection includes a set of ansible modules that perform specific configuration tasks on CVP server. These tasks include: collecting facts, managing configlets, building topology with containers and devices, running tasks.

Arista CloudVision and Ansible

Even if arista.cvp collection is integrated with arista.avd collection to automate configuration deployment, this collection can also be used outside of AVD tasks to populate your Cloudvision server with your own workflows.

Requirements

Arista CloudVision

Current active branch:

Info

Starting version 2.0.0, collection uses cvprac as Cloudvision connection manager. So support for any new CLoudvision server is tied to it support in this python library.

ansible-cvp 1.0.0 1.1.0 >= 2.0.0
2018.2
2019.x
2020.1
>= 2020.2
Python
  • Python >=3.8

Please check the minimum version supported by your ansible installation on ansible website

Additional Python Libraries required

Ansible version:

  • ansible >= 2.9.0

3rd party Python libraries:

  • cvprac
  • requests
  • jsonschema
  • treelib (for modules in version 1)
netaddr>=0.7.19
Jinja2>=2.10.3
paramiko>=2.7.1
requests>=2.22.0
cvprac>=1.2.0
jsonschema>=3.2.0
treelib>=1.5.5

Installation

pip install ansible_collections/arista/cvp/requirements.txt

# For modules in version 1
pip install treelib>=1.5.5

Ansible galaxy hosts all stable version of this collection. Installation from ansible-galaxy is the most convenient approach for consuming arista.cvp content

$ ansible-galaxy collection install arista.cvp
Process install dependency map
Starting collection install process
Installing 'arista.cvp:1.1.0' to '~/.ansible/collections/ansible_collections/arista/cvp'

Complete installation process is available on repository website

Collection overview

This repository provides content for Ansible’s collection arista.cvp with following content:

List of available modules

Version 3:

List of available roles
Deprecated modules

Example

This example outlines how to use arista.cvp to create a containers topology on Arista CloudVision.

A dedicated repository is available for step by step examples on ansible-cvp-toi.

A complete end to end demo using Arista Validated Design collection and CloudVision modules is available as an example.

Below is a very basic example to build a container topology on a CloudVision platform assuming you have 3 veos named veos0{1,3} and a configlet named alias

---
- name: Playbook to demonstrate cvp modules.
  hosts: cv_server
  connection: local
  gather_facts: no
  collections:
    - arista.cvp
  vars:
    # Configlet definition
    device_configuration:
      mlag-01a-config: "{{lookup('file', './config-router-mlag01a.conf')}}"
      mlag-01b-config: "{{lookup('file', './config-router-mlag01b.conf')}}"

    # Container definition
    containers_provision:
        Fabric:
          parentContainerName: Tenant
        Spines:
          parentContainerName: Fabric
        Leaves:
          parentContainerName: Fabric
          configlets:
              - alias
        MLAG01:
          parentContainerName: Leaves

    # Device definition
    devices_provision:
      - fqdn: mlag-01a
        parentContainerName: 'MLAG01'
        configlets:
            - 'mlag-01a-config'
        systemMacAddress: '50:8d:00:e3:78:aa'
      - fqdn: mlag-01b
        parentContainerName: 'MLAG01'
        configlets:
            - 'mlag-01b-config'
        systemMacAddress: '50:8d:00:e3:78:bb'

  tasks:
    - name: "Build Container topology on {{inventory_hostname}}"
      arista.cvp.cv_container_v3:
        topology: '{{containers_provision}}'

    - name: "Configure devices on {{inventory_hostname}}"
      arista.cvp.cv_device_v3:
        devices: '{{devices_provision}}'

As modules of this collection are based on HTTPAPI connection plugin, authentication elements shall be declared using this plugin mechanism and are automatically shared with arista.cvp.cv_* modules.

[development]
cv_server  ansible_host= 10.90.224.122 ansible_httpapi_host=10.90.224.122

[development:vars]
ansible_connection=httpapi
ansible_httpapi_use_ssl=True
ansible_httpapi_validate_certs=False
ansible_user=cvpadmin
ansible_password=ansible
ansible_network_os=eos
ansible_httpapi_port=443

As modules of this collection are based on HTTPAPI connection plugin, authentication elements shall be declared using this plugin mechanism and are automatically shared with arista.cvp.cv_* modules.

License

Project is published under Apache License.

Ask a question

The best platform for general feedback, assistance, and other discussion is our GitHub discussions. To report a bug or request a specific feature, please open a GitHub issue using the appropriate template.

Contributing

Contributing pull requests are gladly welcomed for this repository. If you are planning a big change, please start a discussion first to make sure we’ll be able to merge it.

You can also open an issue to report any problem or to submit enhancement.

A more complete guide for contribution is available in the repository


Last update: February 7, 2022