�
�Udac @` s� d Z d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d
Z d Z
d d l m Z d d
l
m Z d d l m Z d � Z e d k r� e � n d S( s%
The module file for nxos_interfaces
i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust networkt supported_bysy
---
module: nxos_interfaces
version_added: 2.9
short_description: 'Manages interface attributes of NX-OS Interfaces'
description: This module manages the interface attributes of NX-OS interfaces.
author: Trishna Guha (@trishnaguha)
notes:
- Tested against NXOS 7.3.(0)D1(1) on VIRL
options:
config:
description: A dictionary of interface options
type: list
elements: dict
suboptions:
name:
description:
- Full name of interface, e.g. Ethernet1/1, port-channel10.
type: str
required: true
description:
description:
- Interface description.
type: str
enabled:
description:
- Administrative state of the interface.
Set the value to C(true) to administratively enable the interface
or C(false) to disable it
type: bool
speed:
description:
- Interface link speed. Applicable for Ethernet interfaces only.
type: str
mode:
description:
- Manage Layer2 or Layer3 state of the interface.
Applicable for Ethernet and port channel interfaces only.
choices: ['layer2','layer3']
type: str
mtu:
description:
- MTU for a specific interface. Must be an even number between 576 and 9216.
Applicable for Ethernet interfaces only.
type: str
duplex:
description:
- Interface link status. Applicable for Ethernet interfaces only.
type: str
choices: ['full', 'half', 'auto']
ip_forward:
description:
- Enable or disable IP forward feature on SVIs.
Set the value to C(true) to enable or C(false) to disable.
type: bool
fabric_forwarding_anycast_gateway:
description:
- Associate SVI with anycast gateway under VLAN configuration mode.
Applicable for SVI interfaces only.
type: bool
state:
description:
- The state of the configuration after module completion
type: str
choices:
- merged
- replaced
- overridden
- deleted
default: merged
s
# 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
sc
before:
description: The configuration as structured data prior to module invocation.
returned: always
type: list
sample: >
The configuration returned will always be in the same format
of the parameters above.
after:
description: The configuration as structured data after module completion.
returned: when changed
type: list
sample: >
The configuration returned will always be in the same format
of the parameters above.
commands:
description: The set of commands pushed to the remote device.
returned: always
type: list
sample: ['interface Ethernet1/1', 'mtu 1800']
( t
AnsibleModule( t InterfacesArgs( t
Interfacesc C` s; t d t j d t � } t | � j � } | j | � d S( s`
Main entry point for module execution
:returns: the result form module invocation
t
argument_spect supports_check_modeN( R R R t TrueR
t execute_modulet exit_json( t modulet result( ( sP /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_interfaces.pyt main
s t __main__N( t __doc__t
__future__R R R t typet
__metaclass__t ANSIBLE_METADATAt
DOCUMENTATIONt EXAMPLESt RETURNt ansible.module_utils.basicR t? ansible.module_utils.network.nxos.argspec.interfaces.interfacesR t>