�
�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 m Z d d l m Z m
Z
d d
l m Z d d l
m Z i d d 6d d 6d d 6d d 6d d 6Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e d k re � n d
S(! s 1.1t metadata_versiont previewt statust networkt supported_bys�
---
module: nxos_evpn_vni
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages Cisco EVPN VXLAN Network Identifier (VNI).
description:
- Manages Cisco Ethernet Virtual Private Network (EVPN) VXLAN Network
Identifier (VNI) configurations of a Nexus device.
author: Gabriele Gerbino (@GGabriele)
notes:
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
- default, where supported, restores params default value.
- RD override is not permitted. You should set it to the default values
first and then reconfigure it.
- C(route_target_both), C(route_target_import) and
C(route_target_export valid) values are a list of extended communities,
(i.e. ['1.2.3.4:5', '33:55']) or the keywords 'auto' or 'default'.
- The C(route_target_both) property is discouraged due to the inconsistent
behavior of the property across Nexus platforms and image versions.
For this reason it is recommended to use explicit C(route_target_export)
and C(route_target_import) properties instead of C(route_target_both).
- RD valid values are a string in one of the route-distinguisher formats,
the keyword 'auto', or the keyword 'default'.
options:
vni:
description:
- The EVPN VXLAN Network Identifier.
required: true
route_distinguisher:
description:
- The VPN Route Distinguisher (RD). The RD is combined with
the IPv4 or IPv6 prefix learned by the PE router to create a
globally unique address.
required: true
route_target_both:
description:
- Enables/Disables route-target settings for both import and
export target communities using a single property.
route_target_import:
description:
- Sets the route-target 'import' extended communities.
route_target_export:
description:
- Sets the route-target 'export' extended communities.
state:
description:
- Determines whether the config should be present or not
on the device.
default: present
choices: ['present','absent']
s�
- name: vni configuration
nxos_evpn_vni:
vni: 6000
route_distinguisher: "60:10"
route_target_import:
- "5000:10"
- "4100:100"
route_target_export: auto
route_target_both: default
s�
commands:
description: commands sent to the device
returned: always
type: list
sample: ["evpn", "vni 6000 l2", "route-target import 5001:10"]
i����N( t
get_configt load_configt run_commands( t nxos_argument_spect
check_args( t
AnsibleModule( t CustomNetworkConfigt vnit rdt route_distinguishers route-target botht route_target_boths route-target importt route_target_imports route-target exportt route_target_exportc C s^ t j | � } t j d j | � t j � } d } | | k rZ | j | � j d � } n | S( Ns (?:{0}\s)(?P<value>.*)$t t value( t PARAM_TO_COMMAND_KEYMAPt gett ret compilet formatt Mt searcht group( t argt configt modulet commandt
command_reR ( ( sN /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_evpn_vni.pyt get_valueq s c C s� | j � } g } t j | � } t j d j | � t j � } xN | D]F } d } | | j � k rF | j | � j d � } | j
| � qF qF W| S( Ns (?:{0}\s)(?P<value>.*)$R R ( t
splitlinesR R R R R R t stripR R t append( R R R t splitted_configt
value_listR R t lineR ( ( sN /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_evpn_vni.pyt get_route_target_valuez s
c C s� i } t d d d t | � � } d d j | j d � g } | j | � } | r� xX | D]P } | d k rY | d k r� t | | | � | | <q� t | | | � | | <qY qY Wt d � | j � D� � } | s� | } n | j d | d <n | S( Nt indenti t contentst evpns
vni {0} l2R R c s s'