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.pyo

�
�Udac@ssidd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZd	dlmZm	Z	d	d
lm
Z
d	dlmZd	dl
mZddddgZi
dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6Zied6ed6d!d 6Zd"�Zd#�Zd$�Zd%�Zd&�Zd'�Zd(�Zd)�Zed*kroe�nd
S(+s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys	
---
module: nxos_vxlan_vtep
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages VXLAN Network Virtualization Endpoint (NVE).
description:
  - Manages VXLAN Network Virtualization Endpoint (NVE) overlay interface
    that terminates VXLAN tunnels.
author: Gabriele Gerbino (@GGabriele)
notes:
  - Tested against NXOSv 7.3.(0)D1(1) on VIRL
  - The module is used to manage NVE properties, not to create NVE
    interfaces. Use M(nxos_interface) if you wish to do so.
  - C(state=absent) removes the interface.
  - Default, where supported, restores params default value.
options:
  interface:
    description:
      - Interface name for the VXLAN Network Virtualization Endpoint.
    required: true
  description:
    description:
      - Description of the NVE interface.
  host_reachability:
    description:
      - Specify mechanism for host reachability advertisement.
    type: bool
  shutdown:
    description:
      - Administratively shutdown the NVE interface.
    type: bool
  source_interface:
    description:
      - Specify the loopback interface whose IP address should be
        used for the NVE interface.
  source_interface_hold_down_time:
    description:
      - Suppresses advertisement of the NVE loopback address until
        the overlay has converged.
  global_mcast_group_L3:
    description:
      - Global multicast ip prefix for L3 VNIs or the keyword 'default'
        This is available on NX-OS 9K series running 9.2.x or higher.
    version_added: "2.8"
  global_mcast_group_L2:
    description:
      - Global multicast ip prefix for L2 VNIs or the keyword 'default'
        This is available on NX-OS 9K series running 9.2.x or higher.
    version_added: "2.8"
  global_suppress_arp:
    description:
      - Enables ARP suppression for all VNIs
        This is available on NX-OS 9K series running 9.2.x or higher.
    type: bool
    version_added: "2.8"
  global_ingress_replication_bgp:
    description:
      - Configures ingress replication protocol as bgp for all VNIs
        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:
    interface: nve1
    description: default
    host_reachability: default
    source_interface: Loopback0
    source_interface_hold_down_time: 30
    shutdown: default
s
commands:
    description: commands sent to the device
    returned: always
    type: list
    sample: ["interface nve1", "source-interface loopback0",
        "source-interface hold-down-time 30", "description simple description",
        "shutdown", "host-reachability protocol bgp"]
i����N(t
get_configtload_config(tnxos_argument_spect
check_args(trun_commands(t
AnsibleModule(tCustomNetworkConfigtshutdownthost_reachabilitytglobal_ingress_replication_bgptglobal_suppress_arptdescriptionsglobal suppress-arps'global ingress-replication protocol bgpsglobal mcast-group L3tglobal_mcast_group_L3sglobal mcast-group L2tglobal_mcast_group_L2shost-reachability protocol bgpt	interfacessource-interfacetsource_interfacessource-interface hold-down-timetsource_interface_hold_down_timet180c	Cs6|tkr�tjdjt|�tj�}tjdtj�}t}|dkr�y4|j|�rpt}n|j|�r�t}nWq�t	k
r�t}q�Xq2y|j|�r�t}nWq2t	k
r�t}q2XnStjdjt|�tj�}tjdjd�tj�}tjdjt|�tj�}d}|dkr�|j|�rkt}q2t||kr2|j|�j
d	�j�}q2n�|d
krx�|j�D]V}y6t||kr�|j|�j
d	�j�}PnWq�t
k
r
d}q�Xq�Wn|dkr�x|j�D]V}y6d|krid
|kri|j�dj�}PnWq.t
k
r�d}q.Xq.Wn�|dkrx�|j�D]V}y6d|kr�d|kr�|j�dj�}PnWq�t
k
r�d}q�Xq�Wn1t||kr2|j|�j
d	�j�}n|S(Ns
\s+{0}\s*$s\s+no shutdown\s*$Rs(?:{0}\s)(?P<value>.*)$sno descriptions(?:{0}\s)(?P<value>\S+)$tRtvalueRRsglobal mcast-grouptL2iRtL3(tBOOL_PARAMStretcompiletformattPARAM_TO_COMMAND_KEYMAPtMtFalsetsearchtTruet	TypeErrortgrouptstript
splitlinestAttributeErrortsplit(	targtconfigtmoduletREGEXt
NO_SHUT_REGEXRt
NO_DESC_REGEXtSOURCE_INTF_REGEXtline((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pyt	get_value�sj"	





""	$


!cCs�i}tdddt|ddg��}dj|jdj��}|g}|j|�}|r�x$|D]}t|||�||<qkW|jdj�|d<nG|t|�kr�|jdj�|d<x|D]}d||<q�Wn|S(	Ntindentitcontentstflagstalls
interface {0}RR(RRRtparamstlowertget_sectionR2tstr(R,targstexistingtnetcfgtinterface_stringtparentsR+R*((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pytget_existing�s$	

cCski}x^|j�D]P\}}|j|�}|r|j|�}|rV|||<qc|||<qqW|S(N(titemstget(tkey_mapttabletnew_dicttkeyRtnew_key((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pyt
apply_key_map�s
cCsed}d}d}d}x�|D]x}d|kr4qd|krCqd|krX|}qd|krm|}qd|kr�|}qd|kr|}qqW|r�|j|j|��|jd|�n|r�|j|j|��|jd|�n|r%|j|j|��|j|�n|rQ|j|j|��|j|�n|jdd	�|S(
NRs"no source-interface hold-down-timessource-interface hold-down-timesno source-interfacessource-interfacesno host-reachabilityshost-reachabilityisterminal dont-ask(tpoptindextinserttappend(tcommandsR,tsource_interface_commandtno_source_interface_commandtno_host_reachability_commandthost_reachability_commandtcommand((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pytfix_commands�s>
			
cCs�idd6dd6g}t||�}|r�|dddd}tg|D]/}|d	jd
�rL|ddkrL|^qL�r�d
d}|jd|�q�ndS(s�
    global_suppress_arp is an N9k-only command that requires TCAM resources.
    This method checks the current TCAM allocation.
    Note that changing tcam_size requires a switch reboot to take effect.
    s%show hardware access-list tcam regionRRtjsontoutputitTCAM_RegiontTABLE_Sizest	ROW_SizesttypesIngress ARP-Ether ACLt	tcam_sizet0sg'show hardware access-list tcam region' indicates 'ARP-Ether' tcam size is 0 (no allocated resources). s1'global_suppress_arp' will be rejected by device.tmsgN(R	tboolt
startswitht	fail_json(R,tcmdstbodyttcam_regiontiR\((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pytgsa_tcam_checksBcCsJt�}tt|�}tt|�}x�|j�D]{\}}|tkr\|j|�q4|tkr�|jdj|��q4|dkrB|j|�r�|j|�}	d|kr�|jdj|��q?|jdj||	��q�|j	dd�j	dd�t
kr�|jdj|j���|jd|�q�q4d	|krf|jd
|d�q4d|kr�|jd
|d
�q4dj||j��}
|j|
�q4W|r�t
||�}dj|jdj��g}|j|d|�nI|rF|jdrFdj|jdj��g}|j|dg�ndS(Nsno {0}tdefaultsglobal mcast-groups
no {0} {1}t t_t-RMRsglobal mcast-group s L2Rs L3s{0} {1}s
interface {0}RR?(tlistRHRRAR#RLR!RRBtreplaceRR8t	exit_jsonRSR7tadd(R,R<tproposedt	candidateRMtproposed_commandstexisting_commandsRFRtexisting_valueRRR?((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pyt
state_present's<	$cCs6dj|jdj��g}|j|dg�dS(Nsno interface {0}RR?(RR7R8Rl(R,R<RmRnRM((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pytstate_absentPscs=tdtdtdd�dtdtdd�dtdtdd�dtdtdd�d	tdtdd�d
tdtdd�dtdtdd�dtdtdd�d
tdtdd�dtdtdd�dtdddgdddt��}|jt�dg}td|d|dt�}t�}itd6gd6|d6}t||�|jd}t	j
��t|��}t�fd�|jj�D��}i}x�|j�D]�\}	}
|	dkr�t
|
�j�dkr*tj|	�}
|
dkr*|	tkrt}
q'd}
q*nt
|j|	��j�t
|
�j�krg|
||	<qgq�q�Wtdd�}|jd	�r�t|�n|dkr�|s�|jd�nt||||�n(|dkr�|r�t||||�n|r,|j�}||d<t|d<t||�n|j|�dS(NRtrequiredRYR:RR
R]RRRRRRRtstatetchoicestpresenttabsentRet
argument_spectmutually_exclusivetsupports_check_modetchangedRMtwarningsc3s9|]/\}}|dk	r|�kr||fVqdS(N(tNone(t.0tktv(R;(sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pys	<genexpr>ws	R3isrThe proposed NVE interface did not exist. It's recommended to use nxos_interface to create all logical interfaces.(RR(tdictR#R!tupdateRR
RiRR7RtkeysR@RAR:R8tPARAM_TO_DEFAULT_KEYMAPRBR~RRRdRLRrRst
items_textRRk(RyRzR,R}tresultRuR<t
proposed_argsRmRFRRn((R;sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pytmainUsf$
			

%	-


t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRt&ansible.module_utils.network.nxos.nxosRRRRR	tansible.module_utils.basicR
t*ansible.module_utils.network.common.configRRRR!R#R�R2R@RHRSRdRrRsR�t__name__(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vxlan_vtep.pyt<module>sP


G	
	

	;		
	(		)		G

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