.. _cisco.ios.ios_l2_interfaces_module:
***************************
cisco.ios.ios_l2_interfaces
***************************
**Resource Module to configure L2 interfaces.**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module provides declarative management of Layer-2 interface on Cisco IOS devices.
Parameters
----------
.. raw:: html
Parameter |
Choices/Defaults |
Comments |
config
list
/ elements=dictionary
|
|
A dictionary of Layer-2 interface options
|
|
access
dictionary
|
|
Switchport mode access command to configure the interface as a layer 2 access.
|
|
|
vlan
integer
|
|
Configure given VLAN in access port. It's used as the access VLAN ID.
|
|
|
vlan_name
string
|
|
Set VLAN when interface is in access mode.
|
|
mode
string
|
Choices:
- access
- trunk
- dot1q_tunnel
- dynamic
- dynamic_auto
- dynamic_desirable
- private_vlan_host
- private_vlan_promiscuous
- private_vlan_trunk
|
Mode in which interface needs to be configured.
An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.
|
|
name
string
/ required
|
|
Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1.
|
|
trunk
dictionary
|
|
Switchport mode trunk command to configure the interface as a Layer 2 trunk. Note The encapsulation is always set to dot1q.
|
|
|
allowed_vlans
list
/ elements=string
|
|
List of allowed VLANs in a given trunk port. These are the only VLANs that will be configured on the trunk.
|
|
|
encapsulation
string
|
Choices:
- dot1q
- isl
- negotiate
|
Trunking encapsulation when interface is in trunking mode.
|
|
|
native_vlan
integer
|
|
Native VLAN to be configured in trunk port. It's used as the trunk native VLAN ID.
|
|
|
pruning_vlans
list
/ elements=string
|
|
Pruning VLAN to be configured in trunk port. It's used as the trunk pruning VLAN ID.
|
|
voice
dictionary
|
|
Switchport mode voice command to configure the interface with a voice vlan.
|
|
|
vlan
integer
|
|
Configure given voice VLAN on access port. It's used as the voice VLAN ID.
|
|
|
vlan_name
string
|
|
Set VLAN when interface is in access mode.
|
|
|
vlan_tag
string
|
Choices:
- dot1p
- none
- untagged
|
Set VLAN Tag. dot1p (Priority tagged on PVID) none (Don't tell telephone about voice vlan) untagged (Untagged on PVID)
|
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 running-config | section ^interface.
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
- 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 command show running-config | include ip route|ipv6 route executed on device. For state parsed active connection to remote host is not required.
|