.. _cisco.ios.ios_vlans_module:
*******************
cisco.ios.ios_vlans
*******************
**Resource module to configure VLANs.**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module provides declarative management of VLANs on Cisco IOS network devices.
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
config
list
/ elements=dictionary
|
|
A dictionary of VLANs options
|
|
member
dictionary
|
|
Members of VLAN
|
|
|
evi
integer
|
|
Ethernet Virtual Private Network (EVPN)
|
|
|
vni
integer
/ required
|
|
VXLAN vni
|
|
mtu
integer
|
|
VLAN Maximum Transmission Unit.
Refer to vendor documentation for valid values.
This option is DEPRECATED use ios_interfaces to configure mtu, this attribute will be removed after 2027-01-01.
mtu is collected as part of facts, but a mtu command wont be fired if the configuration is present in the playbook.
|
|
name
string
|
|
Ascii name of the VLAN.
NOTE, name should not be named/appended with default as it is reserved for device default vlans.
|
|
private_vlan
dictionary
|
|
Options for private vlan configuration.
|
|
|
associated
list
/ elements=integer
|
|
List of private VLANs associated with the primary . Only works with `type: primary`.
|
|
|
type
string
|
Choices:
- primary
- isolated
- community
|
Private VLAN type
|
|
remote_span
boolean
|
|
Configure as Remote SPAN VLAN
|
|
shutdown
string
|
Choices:
- enabled
- disabled
|
Specifies whether VLAN switching should be administratively enabled or disabled.
When set to enabled, the VLAN interface is administratively shut down, which prevents it from forwarding traffic.
When set to disabled, the VLAN interface is administratively enabled by issuing the internal no shutdown command, allowing it to forward traffic.
The operational state of the VLAN depends on both the administrative state (shutdown or no shutdown) and the physical link status.
|
|
state
string
|
|
Operational state of the VLAN
|
|
vlan_id
integer
/ required
|
|
ID of the VLAN. Range 1-4094
|
|
running_config
string
|
|
This option is used only with state parsed.
The value of this option should be the output received from the IOS device by executing the command show vlan.
The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
|
|
state
string
|
Choices:
merged ←
- replaced
- overridden
- deleted
- rendered
- gathered
- purged
- parsed
|
The state the configuration should be left in
The states rendered, gathered and parsed does not perform any change on the device.
The state rendered will transform the configuration in config option to platform specific CLI commands which will be returned in the rendered key within the result. For state rendered active connection to remote host is not required.
The state gathered will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the gathered key within the result.
The state parsed reads the configuration from running_config option and transforms it into JSON format as per the resource module parameters and the value is returned in the parsed key within the result. The value of running_config option should be the same format as the output of commands show vlan and show running-config | sec ^vlan configuration .+ executed on device. For state parsed active connection to remote host is not required.
|