AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Ansible on Arista EOS 4.33 Automation Complete Guide

By Luca Berton · Published 2024-01-01 · Category: installation

Automate Arista EOS 4.33 with Ansible: arista.eos collection, eAPI, AVD/CVP, EVPN-VXLAN, MLAG, OSPF/BGP, configuration drift.

Arista EOS 4.33 is a current 4.33.x train running on 7050X/7280R/7500R/7800R series switches. Ansible's arista.eos collection plus the Arista Validated Designs (AVD) roles drive day-0 EVPN-VXLAN fabrics, MLAG, OSPF/BGP, and CloudVision (CVP) integration. This is the master Ansible guide for EOS 4.33.

Arista EOS 4.33 release facts

ItemValue
Train4.33.x
ProgrammabilityeAPI (REST/JSON-RPC), gNMI, OpenConfig YANG
Validated automationArista Validated Designs (AVD)
TelemetryTerminAttr/CVP

Ansible-core compatibility

Use ansible-core 2.18 LTS with arista.eos >= 9.0 and AVD ≥ 5.0 roles via arista.avd.

See also: Ansible on Cisco NX-OS 10.4 Automation Complete Guide

Inventory

[eos]
spine01 ansible_host=10.20.0.1
spine02 ansible_host=10.20.0.2
leaf01 ansible_host=10.20.0.10
leaf02 ansible_host=10.20.0.11

[eos:vars]
ansible_network_os=arista.eos.eos
ansible_connection=ansible.netcommon.httpapi
ansible_httpapi_use_ssl=true
ansible_httpapi_validate_certs=false
ansible_user=admin
ansible_password='{{ vault_eos_password }}'

Backup running-config

- name: Backup EOS configs
  hosts: eos
  gather_facts: false
  tasks:
    - name: Save running-config
      arista.eos.eos_config:
        backup: true
        backup_options:
          dir_path: ./backups

See also: Ansible on SONiC Automation Complete Guide

OSPF underlay

- name: OSPFv2 underlay
  hosts: eos
  gather_facts: false
  tasks:
    - name: OSPF
      arista.eos.eos_ospfv2:
        config:
          processes:
            - process_id: 1
              router_id: "{{ rid }}"
              areas:
                - area_id: '0.0.0.0'
        state: merged

MLAG

- name: MLAG between leaf01/leaf02
  hosts: leaf01:leaf02
  gather_facts: false
  tasks:
    - name: MLAG config
      arista.eos.eos_config:
        lines:
          - mlag configuration
          - domain-id mlag1
          - local-interface Vlan4094
          - peer-address 10.0.0.{{ peer_id }}
          - peer-link Port-Channel999

See also: AAP 2.7 Patch Release June 17, 2026: Metrics Backup, 18 CVE Fixes, FIPS Receptor, and Bug Fixes

EVPN-VXLAN with AVD

group_vars/EVPN_FABRIC.yml:

fabric_name: dc1
underlay_routing_protocol: ebgp
overlay_routing_protocol: ebgp
local_users:
  - name: admin
    privilege: 15
    role: network-admin
    sha512_password: "{{ vault_admin_sha512 }}"

Playbook:

- name: Build EVPN fabric with AVD
  hosts: EVPN_FABRIC
  gather_facts: false
  tasks:
    - import_role: { name: arista.avd.eos_designs }
    - import_role: { name: arista.avd.eos_cli_config_gen }
    - import_role: { name: arista.avd.eos_config_deploy_eapi }

CloudVision (CVP) integration

- name: Push configs through CVP
  hosts: localhost
  tasks:
    - name: Apply configlets via CVP
      arista.cvp.cv_configlet_v3:
        configlets:
          spine01: "{{ lookup('ansible.builtin.file', 'intended/spine01.cfg') }}"
        state: present

Drift detection

- name: Drift check on EOS
  hosts: eos
  gather_facts: false
  tasks:
    - name: Compare to intended
      arista.eos.eos_config:
        src: "intended/{{ inventory_hostname }}.cfg"
        diff_against: intended
      register: drift

Best practices

  • Adopt AVD over hand-written templates — it encodes Arista's reference designs and validates inputs.
  • Use eAPI (httpapi) transport for performance; SSH is fallback.
  • Push through CVP for change management and audit when available.
  • Combine drift detection with TerminAttr telemetry to alert on out-of-band changes.

Conclusion

EOS 4.33 with arista.eos and the AVD framework gives the most opinionated, deterministic networking automation experience available today. Ansible orchestrates AVD inputs and CVP delivery for production-grade fabric rollouts.

Connecting Ansible to Arista EOS

# inventory.ini
[arista]
switch1 ansible_host=10.0.0.10

[arista:vars]
ansible_connection=ansible.netcommon.network_cli
ansible_network_os=arista.eos.eos
ansible_user=admin
ansible_password="{{ vault_arista_password }}"
ansible_become=true
ansible_become_method=enable

Common EOS Tasks

- name: Manage Arista EOS switches
  hosts: arista
  gather_facts: false
  tasks:
    - name: Gather EOS facts
      arista.eos.eos_facts:
        gather_subset: all

    - name: Show version info
      ansible.builtin.debug:
        msg: "{{ ansible_net_version }} — {{ ansible_net_model }}"

    - name: Configure VLANs
      arista.eos.eos_vlans:
        config:
          - vlan_id: 100
            name: Production
            state: active
          - vlan_id: 200
            name: Development
            state: active

    - name: Configure interfaces
      arista.eos.eos_l3_interfaces:
        config:
          - name: Management1
            ipv4:
              - address: 10.0.0.10/24

    - name: Save running config
      arista.eos.eos_command:
        commands:
          - write memory

Backup Configuration

    - name: Backup switch config
      arista.eos.eos_config:
        backup: true
        backup_options:
          filename: "{{ inventory_hostname }}_{{ ansible_date_time.date }}.cfg"
          dir_path: /backups/arista/

FAQ

Which collection do I need for Arista EOS?

Install arista.eos: ansible-galaxy collection install arista.eos. It requires ansible.netcommon as a dependency.

Does Ansible support eAPI (REST) for Arista?

Yes. Set ansible_connection=ansible.netcommon.httpapi and ansible_httpapi_use_ssl=true to use eAPI instead of SSH.

Can I manage Arista CloudVision with Ansible?

Yes. Use the arista.cvp collection for CloudVision Portal automation, including configlets, containers, and change control.

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home