Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/nxos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pyc

�
�Udac@sIidd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZd	dlmZm	Z	d	d
l
mZd	dlm
Z
dddgZidd6gd6dd6Zidd6dd6dd6dd6dd6dd6dd6dd6Zd�Zd �Zd!�Zd"�Zd#�Zd$�Zd%�Zed&krEe�nd
S('s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bysF
---
module: nxos_vxlan_vtep_vni
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Creates a Virtual Network Identifier member (VNI)
description:
  - Creates a Virtual Network Identifier member (VNI) for an NVE
    overlay interface.
author: Gabriele Gerbino (@GGabriele)
notes:
  - Tested against NXOSv 7.3.(0)D1(1) on VIRL
  - default, where supported, restores params default value.
options:
  interface:
    description:
      - Interface name for the VXLAN Network Virtualization Endpoint.
    required: true
  vni:
    description:
      - ID of the Virtual Network Identifier.
    required: true
  assoc_vrf:
    description:
      - This attribute is used to identify and separate processing VNIs
        that are associated with a VRF and used for routing. The VRF
        and VNI specified with this command must match the configuration
        of the VNI under the VRF.
    type: bool
  ingress_replication:
    description:
      - Specifies mechanism for host reachability advertisement.
    choices: ['bgp','static', 'default']
  multicast_group:
    description:
      - The multicast group (range) of the VNI. Valid values are
        string and keyword 'default'.
  peer_list:
    description:
      - Set the ingress-replication static peer list. Valid values
        are an array, a space-separated string of ip addresses,
        or the keyword 'default'.
  suppress_arp:
    description:
      - Suppress arp under layer 2 VNI.
    type: bool
  suppress_arp_disable:
    description:
      - Overrides the global ARP suppression config.
        This is available on NX-OS 9K series running 9.2.x or higher.
    type: bool
    version_added: "2.8"
  state:
    description:
      - Determines whether the config should be present or not
        on the device.
    default: present
    choices: ['present','absent']
s[
- nxos_vxlan_vtep_vni:
    interface: nve1
    vni: 6000
    ingress_replication: default
s�
commands:
    description: commands sent to the device
    returned: always
    type: list
    sample: ["interface nve1", "member vni 6000"]
i����N(t
get_configtload_config(tnxos_argument_spect
check_args(t
AnsibleModule(tCustomNetworkConfigt	assoc_vrftsuppress_arptsuppress_arp_disablettmulticast_groupt	peer_listtingress_replications
associate-vrft	interfaces
member vnitvnisingress-replication protocolsmcast-groupspeer-ipssuppress-arpssuppress-arp disablecCs�t|}tjdj|�tj�}|tkrstjdj|�tj�}t}|j|�r�t}q�nl|dkr�|j	|tj�}g}|r�|}q�n3d}|j|tj�}|r�|j
d�}n|S(Ns(?:{0}\s)(?P<value>.*)$s
\s+{0}\s*$RRtvalue(tPARAM_TO_COMMAND_KEYMAPtretcompiletformattMtBOOL_PARAMStFalsetsearchtTruetfindalltgroup(targtconfigtmoduletcommandtcommand_val_ret
command_reRthas_command_val((sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pyt	get_value~s"
cCsOt|�}tjd|tj�}d}|rKdj|jd��}n|S(Ns(?:interface nve)(?P<value>.*)$Rsnve{0}R(tstrRRRRR(R"tnetcfgR!t
has_interfaceR((sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pytcheck_interface�sc	CsZi}tdddt|��}t||�}|rPdj|�g}|j|�}dj|jd�|kr�|jdj|jd��|j|�}nQdj|jd�|kr�|jdj|jd��|j|�}ni}|rPx3|D]+}|d	krt|||�||<qqW||d<|jd|d<qPn||fS(
Ntindentitcontentss
interface {0}smember vni {0} associate-vrfRsmember vni {0}R(s	interfacesvni(R
RR+Rtget_sectiontparamstappendR'(	R"targstexistingR)tinterface_existtparentsttemp_configR!R ((sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pytget_existing�s(

cCsIi}x<|j�D].\}}|j|�}|r|||<qqW|S(N(titemstget(tkey_mapttabletnew_dicttkeyRtnew_key((sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pyt
apply_key_map�sc
s&t��tt|�}tt|�}xP|j�D]B\}}|dkr�dj|jd|�}|s}dj|�}n�j|�q4|dkr�|gkr�x�|D]}	�jdj||	��q�Wq4|dkr�||j|�kr��jdj|��dj|jd�}
|
�krK�jdj|jd��n|tjd	d
�krv�jdj||��qvq4|dkr?||j|�kr?|j|�}tjdd
�}||kr|r�||kr��jd
j||��n�jdj||��qv|rv�jd
j||��qvq4|t	kr[�j|�q4|t
kr��jdj|��q4|d
ks�|gkrQ|j|�r|j|�}
|dkr�xC|
D]}	�jd
j||	��q�WqN�jd
j||
��qv|jdd�jdd�tkrv�jdj|j
���qvq4dj||j
��}�j|�q4W�r"dj|jd�}
d}d}d}d}dj|jd�}t�fd�||||fD��rvg�D]}d|kr�|^q�}||
g}g�D]}d|kr$|^q$�x�D]}|j|�qIW|j|d|�nNd�dkr�g�D]}|^q�}||
|g}|j|d|�n|
�kr"|g}�j|
�|jddkr	|j|
�n|j�d|�q"ndS(Ns
associate-vrfsmember vni {0} {1}Rsno {0}speer-ips{0} {1}smcast-groupsmember vni {0}Rtdefaultsingress-replication protocolRs
no {0} {1}t t_t-s#ingress-replication protocol statics ingress-replication protocol bgps&no ingress-replication protocol statics#no ingress-replication protocol bgps
interface {0}Rc3s|]}|�kVqdS(N((t.0tc(tcommands(sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pys	<genexpr>stpeerR4iR(tlistR>RR7RR/R0R8tPARAM_TO_DEFAULT_KEYMAPRRtreplaceRtlowertanytaddtremovetNone(R"R2tproposedt	candidatetproposed_commandstexisting_commandsR<RR#RFtvni_commandtevaluetdvaluetexisting_valuetingress_replications_commandtingress_replicationb_commandtingress_replicationns_commandtingress_replicationnb_commandtinterface_commandtcmdtstatic_level_cmdsR4((REsT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pyt
state_present�s�	
 ! !
 $"%%
	
cCso|dr&dj|jd�g}ndj|jd�g}dj|jd�g}|j|d|�dS(NRsno member vni {0} associate-vrfRsno member vni {0}s
interface {0}RR4(RR/RL(R"R2RORPRER4((sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pytstate_absents
csDtdtdtdd�dtdtdd�dtdtdd�dtdtdd�d	tdtdd
�dtdtdd�dtdtdd�d
tdtddddddg�dtdddgdddt��	}|jt�d%d&d'd(d)g}td|d|dt�}t�}t||�itd6gd6|d6}|jd	r�|jd	ddkr�|jd
dkr�|j	dd�q�|jd	}|ddkr�d|jd	<q�tt
tj|��}||jd	<n|jd}t
j��t|��\}}	|dkrj|	sA|j	dd�q�|	|jdkr�|j	dd�q�n||dkr�|	|jdkr�|j|�q�|r�|d|jdkr�|j	dd j|jd�d!|d�q�nt�fd"�|jj�D��}
i}x�|
j�D]v\}}
|d*krft|
�j�dkrftj|d�}
qfn|dkr|j|�|
kr|
||<qqWtd#d$�}|dkr�t||||�n(|r�|dkr�t||||�n|r3|j�}t|d<||d<|js3t||�q3n|j|�dS(+NRtrequiredttypeR(RRtboolRRRGRR
RtchoicestbgptstaticR?tstatetpresenttabsentt
argument_spectmutually_exclusivetsupports_check_modetchangedREtwarningsitmsgsAingress_replication=static is required when using peer_list paramsQThe proposed NVE interface does not exist. Use nxos_interface to create it first.s.Only 1 NVE interface is allowed on the switch.s9ERROR: VNI delete failed: Could not find vni node for {0}texisting_vnic3s9|]/\}}|dk	r|�kr||fVqdS(N(RN(RCtktv(R1(sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pys	<genexpr>^s	R,i(RR
(RR(RR(RR
(RR(RRR(tdictRRtupdateRR	RGRR/t	fail_jsontmapR(tstripRtkeysR6t	exit_jsonRR7RJRHR8R
R^R_t
items_textt
check_modeR(RiRjR"RmtresultRtstripped_peer_listRfR2R3t
proposed_argsROR<RRP((R1sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pytmain"s�$$
			

*

	%!

	t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRt&ansible.module_utils.network.nxos.nxosRRRRtansible.module_utils.basicR	t*ansible.module_utils.network.common.configR
RRHRR'R+R6R>R^R_R~t__name__(((sT/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.pyt<module>sF


=	

						T	
	W

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]