�
�Udac @ s� i d d 6d g d 6d d 6Z d Z d Z d Z d d
l Z d d l m Z m Z d d l m Z m Z d d
l m
Z
d d l m Z d � Z
d � Z d � Z d � Z d � Z d � Z e d k r� e � n d
S( s 1.1t metadata_versiont previewt statust networkt supported_bys
---
module: nxos_vrf_interface
extends_documentation_fragment: nxos
version_added: "2.1"
short_description: Manages interface specific VRF configuration.
description:
- Manages interface specific VRF configuration.
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
notes:
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
- VRF needs to be added globally with M(nxos_vrf) before
adding a VRF to an interface.
- Remove a VRF from an interface will still remove
all L3 attributes just as it does from CLI.
- VRF is not read from an interface until IP address is
configured on that interface.
options:
vrf:
description:
- Name of VRF to be managed.
required: true
interface:
description:
- Full name of interface to be managed, i.e. Ethernet1/1.
required: true
state:
description:
- Manages desired state of the resource.
required: false
default: present
choices: ['present','absent']
s�
- name: Ensure vrf ntc exists on Eth1/1
nxos_vrf_interface:
vrf: ntc
interface: Ethernet1/1
state: present
- name: Ensure ntc VRF does not exist on Eth1/1
nxos_vrf_interface:
vrf: ntc
interface: Ethernet1/1
state: absent
s�
commands:
description: commands sent to the device
returned: always
type: list
sample: ["interface loopback16", "vrf member ntc"]
i����N( t load_configt run_commands( t get_capabilitiest nxos_argument_spec( t get_interface_type( t
AnsibleModulec C sC d | k r d } n d } i | d 6| d 6g } t | | � d S( Ns show runt jsont textt commandt outputi ( R ( R
t moduleR t cmds( ( sS /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vrf_interface.pyt execute_show_commandY s
c C s� d j | � } i } d } | d k r� t | | � } y | d d } Wn t k
r\ | SX| r� t | t � r� t | j d d � � } | d k s� | d
k r� d } q� q� | Sn! | d k s� | d
k r� d } n | S( Ns show interface {0}t unknownt ethernett portchannelt TABLE_interfacet
ROW_interfacet eth_modet layer3t accesst trunkt layer2t loopbackt svi( R R ( t formatR t KeyErrort
isinstancet dictt strt get( t interfacet intf_typeR R
t modet bodyt interface_table( ( sS /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vrf_interface.pyt get_interface_modee s"