W3cubDocs

/Ansible 2.9

eos_interfaces – Manages interface attributes of Arista EOS interfaces

New in version 2.9.

Synopsis

  • This module manages the interface attributes of Arista EOS interfaces.

Parameters

Parameter Choices/Defaults Comments
config
list
The provided configuration
description
string
Interface description
duplex
string
Interface link status. Applicable for Ethernet interfaces only.
Values other than auto must also set speed.
Ignored when speed is set above 1000.
enabled
boolean
    Choices:
  • no
  • yes
Administrative state of the interface.
Set the value to true to administratively enable the interface or false to disable it.
mtu
integer
MTU for a specific interface. Must be an even number between 576 and 9216. Applicable for Ethernet interfaces only.
name
string / required
Full name of the interface, e.g. GigabitEthernet1.
speed
string
Interface link speed. Applicable for Ethernet interfaces only.
state
string
    Choices:
  • merged
  • replaced
  • overridden
  • deleted
The state of the configuration after module completion.

Notes

Note

  • Tested against Arista EOS 4.20.10M
  • This module works with connection network_cli. See the EOS Platform Options.

Examples

---

# Using merged

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#    description "Interface 1"
# !
# interface Ethernet2
# !
# interface Management1
#    description "Management interface"
#    ip address dhcp
# !

- name: Merge provided configuration with device configuration
  eos_interfaces:
    config:
      - name: Ethernet1
        enabled: True
      - name: Ethernet2
        description: 'Configured by Ansible'
        enable: False
    state: merged

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
#    description "Interface 1"
# !
# interface Ethernet2
#    description "Configured by Ansible"
#    shutdown
# !
# interface Management1
#    description "Management interface"
#    ip address dhcp
# !

# Using replaced

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#    description "Interface 1"
# !
# interface Ethernet2
# !
# interface Management1
#    description "Management interface"
#    ip address dhcp
# !

- name: Replaces device configuration of listed interfaces with provided configuration
  eos_interfaces:
    config:
      - name: Ethernet1
        enabled: True
      - name: Ethernet2
        description: 'Configured by Ansible'
        enabled: False
    state: replaced

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
# !
# interface Ethernet2
#    description "Configured by Ansible"
#    shutdown
# !
# interface Management1
#    description "Management interface"
#    ip address dhcp
# !

# Using overridden

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#    description "Interface 1"
# !
# interface Ethernet2
# !
# interface Management1
#    description "Management interface"
#    ip address dhcp
# !

- name: Overrides all device configuration with provided configuration
  eos_interfaces:
    config:
      - name: Ethernet1
        enabled: True
      - name: Ethernet2
        description: 'Configured by Ansible'
        enabled: False
    state: overridden

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
# !
# interface Ethernet2
#    description "Configured by Ansible"
#    shutdown
# !
# interface Management1
#    ip address dhcp
# !

# Using deleted

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#    description "Interface 1"
# !
# interface Ethernet2
# !
# interface Management1
#    description "Management interface"
#    ip address dhcp
# !

- name: Delete or return interface parameters to default settings
  eos_interfaces:
    config:
      - name: Ethernet1
    state: deleted

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
# !
# interface Ethernet2
# !
# interface Management1
#    description "Management interface"
#    ip address dhcp
# !

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
after
dictionary
when changed
The configuration as structured data after module completion.

Sample:
The configuration returned will always be in the same format of the parameters above.
before
dictionary
always
The configuration as structured data prior to module invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
commands
list
always
The set of commands pushed to the remote device.

Sample:
['interface Ethernet2', 'shutdown', 'speed 10full']


Status

Red Hat Support

More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.

Authors

  • Nathaniel Case (@qalthos)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/eos_interfaces_module.html