nxos_l2_interfaces – Manages Layer-2 Interfaces attributes of NX-OS Interfaces¶
New in version 2.9.
Parameters¶
Examples¶
# Using merged
# Before state:
# -------------
#
# interface Ethernet1/1
# switchport access vlan 20
# interface Ethernet1/2
# switchport trunk native vlan 20
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
- name: Merge provided configuration with device configuration.
nxos_l2_interfaces:
config:
- name: Ethernet1/1
trunk:
native_vlan: 10
allowed_vlans: 2,4,15
- name: Ethernet1/2
access:
vlan: 30
state: merged
# After state:
# ------------
#
# interface Ethernet1/1
# switchport trunk native vlan 10
# switchport trunk allowed vlans 2,4,15
# interface Ethernet1/2
# switchport access vlan 30
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
# Using replaced
# Before state:
# -------------
#
# interface Ethernet1/1
# switchport access vlan 20
# interface Ethernet1/2
# switchport trunk native vlan 20
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
- name: Replace device configuration of specified L2 interfaces with provided configuration.
nxos_l2_interfaces:
config:
- name: Ethernet1/1
trunk:
native_vlan: 20
trunk_vlans: 5-10, 15
state: replaced
# After state:
# ------------
#
# interface Ethernet1/1
# switchport trunk native vlan 20
# switchport trunk allowed vlan 5-10,15
# interface Ethernet1/2
# switchport trunk native vlan 20
# switchport mode trunk
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
# Using overridden
# Before state:
# -------------
#
# interface Ethernet1/1
# switchport access vlan 20
# interface Ethernet1/2
# switchport trunk native vlan 20
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
- name: Override device configuration of all L2 interfaces on device with provided configuration.
nxos_l2_interfaces:
config:
- name: Ethernet1/2
access:
vlan: 30
state: overridden
# After state:
# ------------
#
# interface Ethernet1/1
# interface Ethernet1/2
# switchport access vlan 30
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
# Using deleted
# Before state:
# -------------
#
# interface Ethernet1/1
# switchport access vlan 20
# interface Ethernet1/2
# switchport trunk native vlan 20
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
- name: Delete L2 attributes of given interfaces (Note This won't delete the interface itself).
nxos_l2_interfaces:
config:
- name: Ethernet1/1
- name: Ethernet1/2
state: deleted
# After state:
# ------------
#
# interface Ethernet1/1
# interface Ethernet1/2
# interface mgmt0
# ip address dhcp
# ipv6 address auto-config
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Network Team. [network]
Red Hat Support¶
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Authors¶
Trishna Guha (@trishnaguha)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.