arista.eos.eos_vlans – VLANs resource module¶
Note
This plugin is part of the arista.eos collection (version 1.3.0).
To install it use: ansible-galaxy collection install arista.eos
.
To use it in a playbook, specify: arista.eos.eos_vlans
.
New in version 1.0.0: of arista.eos
Synopsis¶
This module provides declarative management of VLANs on Arista EOS network devices.
Note
This module has a corresponding action plugin.
Parameters¶
Notes¶
Note
Tested against Arista EOS 4.20.10M
This module works with connection
network_cli
. See the EOS Platform Options.
Examples¶
# 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
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Nathaniel Case (@qalthos)