VLANs resource module
Version added: 1.0.0
- This module provides declarative management of VLANs on Arista EOS network devices.
Note
- Tested against Arista EOS 4.24.6F
- This module works with connection
network_cli
. See the EOS Platform Options.
# Using deleted
# Before state:
# -------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 10
# name ten
# !
# vlan 20
# name twenty
- name: Delete attributes of the given VLANs.
arista.eos.eos_vlans:
config:
- vlan_id: 20
state: deleted
# After state:
# ------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 10
# name ten
# Using merged
# Before state:
# -------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 10
# name ten
# !
# vlan 20
# name twenty
- name: Merge given VLAN attributes with device configuration
arista.eos.eos_vlans:
config:
- vlan_id: 20
state: suspend
state: merged
# After state:
# ------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 10
# name ten
# !
# vlan 20
# name twenty
# state suspend
# Using overridden
# Before state:
# -------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 10
# name ten
# !
# vlan 20
# name twenty
- name: Override device configuration of all VLANs with provided configuration
arista.eos.eos_vlans:
config:
- vlan_id: 20
state: suspend
state: overridden
# After state:
# ------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 20
# state suspend
# Using replaced
# Before state:
# -------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 10
# name ten
# !
# vlan 20
# name twenty
- name: Replace all attributes of specified VLANs with provided configuration
arista.eos.eos_vlans:
config:
- vlan_id: 20
state: suspend
state: replaced
# After state:
# ------------
#
# veos(config-vlan-20)#show running-config | section vlan
# vlan 10
# name ten
# !
# vlan 20
# state suspend
# using parsed
# parsed.cfg
# vlan 10
# name ten
# !
# vlan 20
# name twenty
# state suspend
- name: Use parsed to convert native configs to structured data
arista.eos.eos_vlans:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Output:
# -------
# parsed:
# - vlan_id: 10
# name: ten
# - vlan_id: 20
# state: suspend
# Using rendered:
- name: Use Rendered to convert the structured data to native config
arista.eos.eos_vlans:
config:
- vlan_id: 10
name: ten
- vlan_id: 20
state: suspend
state: rendered
# Output:
# ------
# rendered:
# - "vlan 10"
# - "name ten"
# - "vlan 20"
# - "state suspend"
# Using gathered:
# native_config:
# vlan 10
# name ten
# !
# vlan 20
# name twenty
# state suspend
- name: Gather vlans facts from the device
arista.eos.eos_vlans:
state: gathered
# Output:
# ------
# gathered:
# - vlan_id: 10
# name: ten
# - vlan_id: 20
# state: suspend
Common return values are documented here, the following are the fields unique to this module:
- Nathaniel Case (@qalthos)