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

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZd	dlmZm	Z	d	d
l
mZd	dlm
Z
dgZi
dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d!6d"d6Zid#d6d$d6d$d6d%d6d$d6d&d6d'd 6d(d!6d)d6ed6d)d6d)d6Zd*�Zd+�Zd,�Zd-�Zd.�Zd/�Zed0kr�e�nd
S(1s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys�
---
module: nxos_ospf_vrf
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages a VRF for an OSPF router.
description:
  - Manages a VRF for an OSPF router.
author: Gabriele Gerbino (@GGabriele)
notes:
  - Tested against NXOSv 7.3.(0)D1(1) on VIRL
  - Value I(default) restores params default value, if any.
    Otherwise it removes the existing param configuration.
options:
  vrf:
    description:
      - Name of the resource instance. Valid value is a string.
        The name 'default' is a valid VRF representing the global OSPF.
    default: default
  ospf:
    description:
      - Name of the OSPF instance.
    required: true
  router_id:
    description:
      - Router Identifier (ID) of the OSPF router VRF instance.
  default_metric:
    description:
      - Specify the default Metric value. Valid values are an integer
        or the keyword 'default'.
  log_adjacency:
    description:
      - Controls the level of log messages generated whenever a
        neighbor changes state. Valid values are 'log', 'detail',
        and 'default'.
    choices: ['log','detail','default']
  timer_throttle_lsa_start:
    description:
      - Specify the start interval for rate-limiting Link-State
        Advertisement (LSA) generation. Valid values are an integer,
        in milliseconds, or the keyword 'default'.
  timer_throttle_lsa_hold:
    description:
      - Specify the hold interval for rate-limiting Link-State
        Advertisement (LSA) generation. Valid values are an integer,
        in milliseconds, or the keyword 'default'.
  timer_throttle_lsa_max:
    description:
      - Specify the max interval for rate-limiting Link-State
        Advertisement (LSA) generation. Valid values are an integer,
        in milliseconds, or the keyword 'default'.
  timer_throttle_spf_start:
    description:
      - Specify initial Shortest Path First (SPF) schedule delay.
        Valid values are an integer, in milliseconds, or
        the keyword 'default'.
  timer_throttle_spf_hold:
    description:
      - Specify minimum hold time between Shortest Path First (SPF)
        calculations. Valid values are an integer, in milliseconds,
        or the keyword 'default'.
  timer_throttle_spf_max:
    description:
      - Specify the maximum wait time between Shortest Path First (SPF)
        calculations. Valid values are an integer, in milliseconds,
        or the keyword 'default'.
  auto_cost:
    description:
      - Specifies the reference bandwidth used to assign OSPF cost.
        Valid values are an integer, in Mbps, or the keyword 'default'.
  bfd:
    description:
      - Enables BFD on all OSPF interfaces.
      - "Dependency: 'feature bfd'"
    version_added: "2.9"
    type: str
    choices: ['enable', 'disable']
  passive_interface:
    description:
      - Setting to C(yes) will suppress routing update on interface.
    version_added: "2.4"
    type: bool
  state:
    description:
      - State of ospf vrf configuration.
    default: present
    choices: ['present', 'absent']
s
- nxos_ospf_vrf:
    ospf: 1
    timer_throttle_spf_start: 50
    timer_throttle_spf_hold: 1000
    timer_throttle_spf_max: 2000
    timer_throttle_lsa_start: 60
    timer_throttle_lsa_hold: 1100
    timer_throttle_lsa_max: 3000
    vrf: test
    bfd: enable
    state: present
s�
commands:
    description: commands sent to the device
    returned: always
    type: list
    sample:
      - router ospf 1
      - vrf test
      - bfd
      - timers throttle lsa 60 1100 3000
i����N(t
get_configtload_config(tnxos_argument_spect
check_args(t
AnsibleModule(tCustomNetworkConfigtpassive_interfacetvrfs	router-idt	router_idsdefault-metrictdefault_metricslog-adjacency-changest
log_adjacencystimers throttle lsattimer_throttle_lsa_startttimer_throttle_lsa_maxttimer_throttle_lsa_holdstimers throttle spfttimer_throttle_spf_maxttimer_throttle_spf_startttimer_throttle_spf_holdsauto-cost reference-bandwidtht	auto_costtbfdspassive-interface defaultt0t5000t200t1000t40000tdisabletcCshi}tdddt|��}dj|jd�g}|jddkrm|jdj|jd��n|j|�}x0|D](}|d*kr�tj|�||<q�q�W|rd|jddkr@|j�}t	}xAt
d	t|�d
�D]&}	d||	j�kr�|	}Pq�q�W|r@dj
|d	|!�}q@n|j�}x�|D]�}
d|
krrt|d
<qSd|
kr�tjd|
�jd
�|d<qSd|
kr�tjd|
�jd
�|d<qSd|
krtjd|
�jd
�}|r||d<q;d|d<qSd|
krntjd|
�jd
�}d|
kr[t|�d}nt|�|d<qSd|
kr�d|d<qSd|
kr�tjd |
�}
|
jd
�|d!<|
jd�|d"<|
jd#�|d$<qSd%|
krStjd&|
�}
|
jd
�|d'<|
jd�|d(<|
jd#�|d)<qSqSW|jd|d<|jd|d<n|S(+Ntindentitcontentssrouter ospf {0}tospfRtdefaultsvrf {0}iis
tpassiveRs	router-idsrouter-id (\S+)R
tmetricsdefault-metric (\S+)Rt	adjacencys log-adjacency-changes(?: (\S+))?Rtlogtautos)auto-cost reference-bandwidth (\d+) (\S+)tGbpsi�RRtenablestimers throttle lsas%timers throttle lsa (\S+) (\S+) (\S+)RRiRstimers throttle spfs%timers throttle spf (\S+) (\S+) (\S+)RRR(sospfsvrf(R
Rtformattparamstappendtget_sectiontPARAM_TO_DEFAULT_KEYMAPtgett
splitlinestFalsetrangetlentstriptjointTruetretsearchtgrouptinttstr(tmoduletargstexistingtnetcfgtparentstconfigtargtsplitted_configt	vrf_indextindextlineR&tcostttmp((sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pytget_existing�sh 
 

""


cCsFi}x9|D]1}|j|�}|r
|j|�||<q
q
W|S(N(R/(tkey_mapttabletnew_dicttkeytnew_key((sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pyt
apply_key_map�s
cCs-|j|�r|j|�Stj|�SdS(N(R/R.(RMtproposed((sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pyt
get_timer_prd�s
c	Cs6t�}tt|�}tt|�}x�|j�D]�\}}|dkrRq4n|tkrn|j|�q4|tkr�|dkr�|j|�r�|jdj|��q�q�|jdj|��q4|dks�|dkrD|dkr|jdj|��q�|j|�r�|j|�}	|jdj||	��q�q4|dkr�d	j|t	d
|�t	d|�t	d|��}
n$|d
kr�d	j|t	d|�t	d|�t	d|��}
n�|dkr
|dkr�|}
q�|dkr�dj||�}
q�n�|dkrkt
|�dkr@dj||�}
q�tt|�d�}dj||�}
n?|dkr�|dkr�dnd}
ndj||j
��}
|
|kr4|j|
�q4q4W|r2dj|jd�g}|jddkr|jdj|jd��n|j|d|�ndS( NRspassive-interface defaultsno {0}R"Rslog-adjacency-changess
no {0} {1}stimers throttle lsas{0} {1} {2} {3}RRRstimers throttle spfRRRR&tdetails{0} {1}sauto-cost reference-bandwidthis{0} {1} Mbpsi�s{0} {1} GbpsRRsno bfdsrouter ospf {0}R!svrf {0}R@(tlistROtPARAM_TO_COMMAND_KEYMAPtitemsR6R,R1R/R*RQR3R;R:tlowerR+tadd(R<R>RPt	candidatetcommandstproposed_commandstexisting_commandsRMtvaluetexisting_valuetcommandR@((sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pyt
state_presentsf		 c
Cs�g}dj|jd�g}|jddkr`tt|�}xc|j�D]\}}|rN|dkrNd}	|dkr�dj|�}	n�|dkr|dtjd�ks�|d	tjd	�ks�|d
tjd
�kr1dj||d|d	|d
�}	q1n |dkr�|d
tjd
�ksh|dtjd�ksh|dtjd�kr1dj||d
|d|d�}	q1n�|dkr�dj|�}	n�|dkr�|tjd�kr�dj|�}	q1d}	nE|dkr|dkr1d}	q1n!|j|�}
dj||
�}	|	rY|	|krV|j|	�qVqYqNqNWnG|jd�r�|jd�|jdkr�dj|jd�g}n|r�|j	|d|�ndS(Nsrouter ospf {0}R!RR"spassive-interface defaultsno {0}stimers throttle lsaRRRsno {0} {1} {2} {3}stimers throttle spfRRRslog-adjacency-changessauto-cost reference-bandwidthRRR)sno bfds
no {0} {1}s
no vrf {0}R@(
R*R+RORTRUtNoneR.R/R,RW(R<R>RPRXRYR@R[RMR\R^R]((sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pytstate_absent?sh	c%s�tdtdtdddd�dtdtdd�dtdtdd�dtdtdd�d	tdtddd
dddg�d
tdtdd�dtdtdd�dtdtdd�dtdtdd�dtdtdd�dtdtdd�dtdtdd�dtdtddd
ddg�dtdtdd�dtd
ddgdddt��}|jt�td|dt�}t�}t||�tdtdgd |�}|jd}t	j
��t|��}t�fd!�|jj�D��}i}x�|j�D]�\}}	|d"kr$t
|	�j�d#kr]t}	n`t
|	�j�d$kr~t}	n?t
|	�j�dkr�tj|�}	|	dkr�d}	q�n|j|�|	kr�|	||<q�q$q$Wtd%d&�}
|dkrt||||
�n|dkr?|r?t||||
�n|
r�|
j�}
|
|d<|js�t||
�t|d<q�n|j|�dS('NRtrequiredttypeR;R"R!R
RRtchoicesR&RRRRRRRRRRR)RRtbooltstatetpresenttabsentt
argument_spectsupports_check_modetchangedRYtwarningsc3s9|]/\}}|dk	r|�kr||fVqdS(N(R`(t.0tktv(R=(sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pys	<genexpr>�s	t	interfacettruetfalseRi(tdictR1R6tupdateRR	RSRR+RTtkeysRIRUR;RVR.R/R`R
R_Rat
items_textt
check_modeRt	exit_json(RiR<RltresultRfR>t
proposed_argsRPRMR\RX((R=sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pytmain{sd$!$
	

%		
	
t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR7t&ansible.module_utils.network.nxos.nxosRRRRtansible.module_utils.basicR	t*ansible.module_utils.network.common.configR
tBOOL_PARAMSRTR1R.RIRORQR_RaR{t__name__(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_ospf_vrf.pyt<module>s\


Y	

	=				?	<	>

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