arista.eos-route-control

Route Control Role for EOS

The arista.eos-route-control role simplifies the setup of routing policies in EOS. You don't have to create complex Ansible tasks. Just prepare an object that meets the outlined criteria, and this role will handle the rest for you.

This role is designed to set up route maps and static IPv4 routes.

Installation

To install the role, run the following command:

ansible-galaxy install arista.eos-route-control

Requirements

You need an SSH connection to your Arista device. You can use any built-in EOS connection variables or the provider dictionary for convenience.

Role Variables

The role works with routemaps and ipv4_static_routes objects, detailed below:

routemaps (list): Each entry consists of the following:

  • name (string, required): The name of the route map.
  • action (choices: permit, deny, required): The action for this route map.
  • seqno (int, required): The sequence number for the rule.
  • description (string): A brief description of the route map entry.
  • match (list): Match statements for the route map (omit 'match' from the start of strings).
  • set (list): Set statements for the route map (omit 'set' from the start of strings).
  • continue (int): Next clause to evaluate.
  • state (choices: present, absent): Specifies if the route map should be present or not.

ipv4_static_routes (list): Each entry consists of the following:

  • ip_dest (string, required): Destination IP address or network.
  • next_hop (string, required): The next hop for the route.
  • next_hop_ip (string): Next router's IP address (only valid when next_hop is an interface).
  • distance (int): Route distance (defaults to 1 if present).
  • tag (int): Tag for the route (defaults to 0 if present).
  • route_name (string): A descriptive name for the route.
  • state (choices: present, absent): Specifies if the route should be present or not.

Note: An asterisk () indicates the default value if none is given.*

Configuration Variables

Key Choices Description
eos_save_running_config true*, false Determines whether to save changes to memory.

Note: An asterisk () indicates the default value if none is given.*

Connection Variables

You need to provide the following connection information to communicate with your devices:

Key Required Choices Description
host yes DNS host name or address for the device.
port no Port for the connection (defaults to standard ports).
username no Username for authentication.
password no Password for authentication.
ssh_keyfile no SSH keyfile for authentication (only used with transport=cli).
authorize no yes, no* Indicates if privileged mode should be entered before commands.
auth_pass no Password for privileged mode (used only if authorize=yes).
transport yes cli*, eapi Specifies how to connect to the device (CLI or eAPI).
use_ssl no yes*, no Use SSL for connections when using the eAPI transport.
provider no Method to pass connection arguments as a dictionary.

Note: An asterisk () indicates the default value if none is given.*

Ansible Variables

Key Choices Description
no_log true, false* Prevents logging of module arguments and outputs during execution.

Note: An asterisk () indicates the default value if none is given.*

Dependencies

This role requires Ansible version 2.1.0 or higher.

Example Playbook

Here’s an example of how to use the role to configure a route map and a static route. You'll create a hosts file and a host_vars file for your switch, followed by a playbook that references the eos-route-control role.

Sample hosts file:

[leafs]
leaf1.example.com

Sample host_vars/leaf1.example.com:

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

routemaps:
  - name: RM-1
    action: permit
    seqno: 10
    description: My wonderful routemap
    match:
      - as 1000
      - source-protocol bgp
    continue: 20
  - name: RM-1
    action: permit
    seqno: 20
    description: My wonderful routemap
    set:
      - distance 50
      - tag 100

ipv4_static_routes:
  - ip_dest: 0.0.0.0/0
    next_hop: Management1
    next_hop_ip: 172.16.130.2
    route_name: Default
    tag: 100

Simple playbook (leaf.yml):

- hosts: leafs
  roles:
    - arista.eos-route-control

Then run it with the following command:

ansible-playbook -i hosts leaf.yml

Developer Information

Contributions are welcome! Refer to the Arista Roles for Ansible - Development Guidelines for details on how to contribute and test.

License

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

Redistribution and use are permitted under certain conditions outlined above.

Author Information

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

Informazioni sul progetto

Role for managing EOS Routemaps and IPv4 static routing configuration

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