Skip to content

Home

Ansible Collection For Arista Validated Designs

Arista AVD Overview

Table of Contents:

About

Arista Networks supports Ansible for managing devices running the EOS operating system natively through eapi or CloudVision Portal (CVP). This collection includes a set of ansible roles and modules to help kick-start your automation with Arista. The various roles and templates provided are designed to be customized and extended to your needs!

Full documentation for the collection is available on read-the-docs:

Validated Designs

The arista.avd collection provides abstracted data models and framework to build, document, deploy and validate the following designs:

L3LS EVPN:

Underlay Overlay Topology
eBGP eBGP [ 3 stage, 5 stage ] + L2 Leafs
ISIS eBGP [ 3 stage ] + L2 Leafs
ISIS iBGP [ 3 stage ] + L2 Leafs
OSPF eBGP [ 3 stage ] + L2 Leafs
OSPF iBGP [ 3 stage ] + L2 Leafs
RFC5549(eBGP) eBGP [ 3 stage ] + L2 Leafs

Roles Overview

This repository provides roles for Ansible’s collection arista.avd with the following content:

Arista AVD Overview

Custom Plugins & Modules

This repository provides custom plugins for Ansible’s collection arista.avd :

Installation

Requirements

Arista EOS:

  • EOS 4.21.8M or later
  • Roles validated with eAPI transport -> ansible_connection: httpapi

Python:

  • Python 3.8 or later

Supported Ansible Versions:

  • ansible-core 2.11.3 or later

Additional Python Libraries required:

  • netaddr
  • Jinja2
  • treelib
  • cvprac
  • paramiko
  • jsonschema
  • requests
  • PyYAML
  • md-toc

Ansible + Additional Python Libraries Installation:

$ pip3 install ansible-core>=2.11.3

$ pip3 install -r requirements.txt

requirements.txt content:

netaddr>=0.7.19
Jinja2>=2.11.3
treelib>=1.5.5
cvprac>=1.0.7
paramiko>=2.7.1
jsonschema>=3.2.0
requests>=2.25.1
PyYAML>=5.4.1
md-toc>=7.1.0

Ansible Configuration INI file:

  • enable jinja2 extensions: loop controls and do
  • By default, Ansible will issue a warning when a duplicate dict key is encountered in YAML. We recommend to change to error instead and stop playbook execution when a duplicate key is detected.
jinja2_extensions=jinja2.ext.loopcontrols,jinja2.ext.do
duplicate_dict_key=error
Installation from ansible-galaxy

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

ansible-galaxy collection install arista.avd

Example Playbooks

An example playbook to deploy an Arista Validated Design via CloudVision:

Figure 1: Example Playbook CloudVision Deployment

# Play to build EOS configuration from EOS_DESIGNS
- hosts: DC1_FABRIC
  tasks:

    # BUILD EOS configuration
    - name: generate intended variables
      import_role:
         name: arista.avd.eos_designs
    - name: generate device intended config and documentation
      import_role:
         name: arista.avd.eos_cli_config_gen

# Play to configure Cloudvision
- hosts: CVP
  tasks:

  # Generate Cloudvision configuration & deployment
  - name: upload cvp configlets
    import_role:
        name: arista.avd.cvp_configlet_upload
    vars:
      configlet_directory: 'configlets/'
      file_extension: 'txt'
      configlets_cvp_prefix: 'DC1-AVD'
    - name: deploy configuration via CVP
      import_role:
         name: arista.avd.eos_config_deploy_cvp

Execute eos_state_validation playbook once change control has been approved and deployed to devices in CVP. Note: To run this playbook, ansible_host must be configured in your inventory for every EOS device. eAPI access must be configured and allowed in your networks.

# EOS eAPI state validation
- hosts: DC1_FABRIC
  tasks:
    - name: audit fabric state using EOS eAPI connection
      import_role:
         name: arista.avd.eos_validate_state

An example playbook to deploy an Arista Validated Design via EOS eAPI:

Figure 2: Example Playbook CloudVision Deployment

# Play to build EOS configuration from EOS_DESIGNS + Deploy using eAPI
- hosts: DC1_FABRIC
  tasks:

    # BUILD EOS configuration
    - name: generate intended variables
      import_role:
         name: arista.avd.eos_designs
    - name: generate device intended config and documentation
      import_role:
         name: arista.avd.eos_cli_config_gen

    # EOS eAPI deploy
    - name: deploy configuration via eAPI
      import_role:
         name: arista.avd.eos_config_deploy_eapi

    # EOS eAPI state validation
    - name: audit fabric state using EOS eAPI connection
      import_role:
         name: arista.avd.eos_validate_state

Full examples with variables and outputs, are located here:

Arista NetDevOps Examples

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.

License

Project is published under Apache 2.0 License


Last update: September 11, 2021
Back to top