nxos_interfaces – Manages interface attributes of NX-OS Interfaces¶
New in version 2.9.
Parameters¶
Examples¶
# Using merged
# Before state:
# -------------
#
# interface Ethernet1/1
#   description testing
#   mtu 1800
- name: Merge provided configuration with device configuration
  nxos_interfaces:
    config:
      - name: Ethernet1/1
        description: 'Configured by Ansible'
        enabled: True
      - name: Ethernet1/2
        description: 'Configured by Ansible Network'
        enabled: False
    state: merged
# After state:
# ------------
#
# interface Ethernet1/1
#    description Configured by Ansible
#    no shutdown
#    mtu 1800
# interface Ethernet2
#    description Configured by Ansible Network
#    shutdown
# Using replaced
# Before state:
# -------------
#
# interface Ethernet1/1
#    description Interface 1/1
# interface Ethernet1/2
- name: Replaces device configuration of listed interfaces with provided configuration
  nxos_interfaces:
    config:
      - name: Ethernet1/1
        description: 'Configured by Ansible'
        enabled: True
        mtu: 2000
      - name: Ethernet1/2
        description: 'Configured by Ansible Network'
        enabled: False
        mode: layer2
    state: replaced
# After state:
# ------------
#
# interface Ethernet1/1
#   description Configured by Ansible
#   no shutdown
#   mtu 1500
# interface Ethernet2/2
#    description Configured by Ansible Network
#    shutdown
#    switchport
# Using overridden
# Before state:
# -------------
#
# interface Ethernet1/1
#    description Interface Ethernet1/1
# interface Ethernet1/2
# interface mgmt0
#    description Management interface
#    ip address dhcp
- name: Override device configuration of all interfaces with provided configuration
  nxos_interfaces:
    config:
      - name: Ethernet1/1
        enabled: True
      - name: Ethernet1/2
        description: 'Configured by Ansible Network'
        enabled: False
    state: overridden
# After state:
# ------------
#
# interface Ethernet1/1
# interface Ethernet1/2
#    description Configured by Ansible Network
#    shutdown
# interface mgmt0
#    ip address dhcp
# Using deleted
# Before state:
# -------------
#
# interface Ethernet1/1
#    description Interface Ethernet1/1
# interface Ethernet1/2
# interface mgmt0
#    description Management interface
#    ip address dhcp
- name: Delete or return interface parameters to default settings
  nxos_interfaces:
    config:
      - name: Ethernet1/1
    state: deleted
# After state:
# ------------
#
# interface Ethernet1/1
# interface Ethernet1/2
# interface mgmt0
#    description Management interface
#    ip address dhcp
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.
