arista.eos-mlag

MLAG Role for EOS

The arista.eos-mlag role simplifies the setup of MLAG (Multi-Chassis Link Aggregation). With this role, you don't need to manually create Ansible tasks. Instead, just input a specific object as per the guidelines below, and the role will handle the configuration for you.

Installation

To install the role, use the following command:

ansible-galaxy install arista.eos-mlag

Requirements

You'll need an SSH connection to your Arista device. You can use built-in connection variables or a convenient provider dictionary.

Role Variables

The mlag dictionary contains the following keys:

Key Type Description
mlag_domain_id string Name of the MLAG Domain
mlag_trunk_group string Trunk group for the Vlan
mlag_shutdown boolean: true, false* Enable or disable the MLAG configuration
local_if_vlan string (required) The Vlan for the peer link, e.g., Vlan1024
local_if_vlan_description string Description for the local_if_vlan
local_if_ip_address string (required) IP Address for the local_if_vlan
local_if_disable_spanning_tree boolean: true*, false Enable or disable STP on the peer Vlan
peer_address string (required) IP Address for the MLAG Peer
peer_link_if string (required) The Port-Channel for the peer link
peer_link_mode choices: trunk*, access Mode for the peer link
peer_link_lacp_mode choices: active*, passive, disabled LACP mode for each Port-Channel member
peer_link_enable boolean: true*, false Enable or disable peer link member interfaces
peer_link_members (List) Interfaces making up the peer link
state boolean: present*, absent Add or remove all MLAG configuration

An asterisk () indicates the default value if none is specified.

Configuration Variables

Key Choices Description
eos_save_running_config true*, false Save changes to the running-config to memory.

Connection Variables

For Ansible EOS roles, you'll need the following connection details for your inventory nodes. These can be specified in group_vars, host_vars, or in your playbook.

Key Required Choices Description
host yes DNS name or address for the remote device.
port no Port for the remote device connection. Defaults to common ports if not provided.
username no Username for authenticating the connection. Defaults to ANSIBLE_NET_USERNAME if not specified.
password no Password for authenticating the connection. Defaults to ANSIBLE_NET_PASSWORD if not specified.
ssh_keyfile no SSH key for authenticating the connection (only for CLI). Defaults to ANSIBLE_NET_SSH_KEYFILE.
authorize no yes, no* Enter privileged mode on the remote device if set to yes. Defaults to ANSIBLE_NET_AUTHORIZE.
auth_pass no Password for entering privileged mode. Defaults to ANSIBLE_NET_AUTH_PASS if needed.
transport yes cli*, eapi Connection method (ssh or eAPI).
use_ssl no yes*, no Use SSL when connecting over eAPI. Ignored for CLI.
provider no Pass connection arguments as a dictionary.

An asterisk () indicates the default value if none is specified.

Ansible Variables

Key Choices Description
no_log true, false* Prevent logging of module arguments and output. Defaults to true for tasks that gather configuration info.

An asterisk () indicates the default value if none is specified.

Dependencies

The eos-bridging role relies on modules present in the core Ansible package. These modules were added in Ansible version 2.1.

  • Requires Ansible 2.1.0 or newer.

Example Playbook

Here's how to use the arista.eos-mlag role to set up MLAG on two leaf switches without writing any tasks. Create a hosts file for the switches, host_vars for each switch, and a simple playbook.

Sample hosts file:

[leafs]
leaf1.example.com
leaf2.example.com

Sample host_vars/leaf1.example.com:

provider:
  host: "{{ inventory_hostname }}"
  username: admin
  password: admin
  use_ssl: no
  authorize: yes
  transport: cli

mlag:
  mlag_domain_id: mlag1
  mlag_trunk_group: mlagpeer
  mlag_shutdown: false
  local_if_vlan: Vlan1024
  local_if_vlan_description: Peer MLAG Link
  local_if_ip_address: 10.0.0.1/30
  local_if_disable_spanning_tree: true
  peer_address: 10.0.0.2
  peer_link_if: Port-Channel10
  peer_link_mode: trunk
  peer_link_lacp_mode: active
  peer_link_enable: true
  peer_link_members:
    - Ethernet3
    - Ethernet4

Sample host_vars/leaf2.example.com:

host: "{{ inventory_hostname }}"
username: admin
password: admin
use_ssl: no
authorize: yes
transport: cli

no_log: true

mlag:
  mlag_domain_id: mlag1
  mlag_trunk_group: mlagpeer
  mlag_shutdown: false
  local_if_vlan: Vlan1024
  local_if_ip_address: 10.0.0.2/30
  local_if_disable_spanning_tree: true
  peer_address: 10.0.0.1
  peer_link_if: Port-Channel10
  peer_link_mode: trunk
  peer_link_lacp_mode: active
  peer_link_enable: true
  peer_link_members:
    - Ethernet3
    - Ethernet4

Playbook to enable MLAG on your leaf switches (leaf.yml):

- hosts: leafs
  roles:
    - arista.eos-mlag

Run the playbook with:

ansible-playbook -i hosts leaf.yml

Developer Information

Contributions are welcome. For development guidelines, see Arista Roles for Ansible - Development Guidelines (link to guidelines).

License

Copyright (c) 2015, Arista Networks EOS+ All rights reserved.

You can redistribute and modify this software under specific conditions detailed in the full license text.

Author Information

For issues, please use our GitHub repo or email us at ansible-dev@arista.com.

Informazioni sul progetto

Role for managing MLAG configuration

Installa
ansible-galaxy install arista.eos-mlag
Licenza
bsd-3-clause
Download
12.1k
Proprietario
Applications developed and supported by Arista EOS+