nxos_vlans – Create VLAN and manage VLAN configurations on NX-OS Interfaces¶
New in version 2.9.
Parameters¶
Examples¶
# Using merged
# Before state:
# -------------
# vlan 1
- name: Merge provided configuration with device configuration.
  nxos_vlans:
    config:
      - vlan_id: 5
        name: test-vlan5
      - vlan_id: 10
        enabled: False
    state: merged
# After state:
# ------------
# vlan 5
#   name test-vlan5
#   state active
#   no shutdown
# vlan 10
#   state active
#   shutdown
# Using replaced
# Before state:
# -------------
# vlan 1
# vlan 5
#   name test-vlan5
# vlan 10
#   shutdown
- name: Replace device configuration of specified vlan with provided configuration.
  nxos_vlans:
    config:
      - vlan_id: 5
        name: test-vlan
        enabled: False
      - vlan_id: 10
        enabled: False
    state: replaced
# After state:
# ------------
# vlan 1
# vlan 5
#   name test-vlan
#   state active
#   shutdown
# vlan 10
#   state active
#   shutdown
# Using overridden
# Before state:
# -------------
# vlan 1
# vlan 3
#   name testing
# vlan 5
#   name test-vlan5
#   shutdown
# vlan 10
#   shutdown
- name: Override device configuration of all vlans with provided configuration.
  nxos_vlans:
    config:
      - vlan_id: 5
        name: test-vlan
      - vlan_id: 10
        state: active
    state: overridden
# After state:
# ------------
# vlan 1
# vlan 5
#   name test-vlan
#   state active
#   no shutdown
# vlan 10
#   state active
#   no shutdown
# Using deleted
# Before state:
# -------------
# vlan 1
# vlan 5
# vlan 10
- name: Delete vlans.
  nxos_vlans:
    config:
      - vlan_id: 5
      - vlan_id: 10
    state: deleted
# After state:
# ------------
# vlan 1
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.
