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_vtp_domain.pyc

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lmZmZd	dlmZmZd	dlm	Z	d	d
l
mZd	dlZdd�Z
d�Zd�Zd�Zd�Zedkr�e�ndS(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bysd
---
module: nxos_vtp_domain
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages VTP domain configuration.
description:
    - Manages VTP domain configuration.
author:
    - Gabriele Gerbino (@GGabriele)
notes:
    - Tested against NXOSv 7.3.(0)D1(1) on VIRL
    - VTP feature must be active on the device to use this module.
    - This module is used to manage only VTP domain names.
    - VTP domain names are case-sensible.
    - If it's never been configured before, VTP version is set to 1 by default.
      Otherwise, it leaves the previous configured version untouched.
      Use M(nxos_vtp_version) to change it.
    - Use this in combination with M(nxos_vtp_password) and M(nxos_vtp_version)
      to fully manage VTP operations.
options:
    domain:
        description:
            - VTP domain name.
        required: true
s�
# ENSURE VTP DOMAIN IS CONFIGURED
- nxos_vtp_domain:
    domain: ntc
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
s�
proposed:
    description: k/v pairs of parameters passed into module
    returned: always
    type: dict
    sample: {"domain": "ntc"}
existing:
    description:
        - k/v pairs of existing vtp domain
    returned: always
    type: dict
    sample: {"domain": "testing", "version": "2", "vtp_password": ""}
end_state:
    description: k/v pairs of vtp domain after module execution
    returned: always
    type: dict
    sample: {"domain": "ntc", "version": "2", "vtp_password": ""}
updates:
    description: command sent to the device
    returned: always
    type: list
    sample: ["vtp domain ntc"]
changed:
    description: check to see if a change was made on the device
    returned: always
    type: bool
    sample: true
i����(tload_configtrun_commands(tnxos_argument_spect
check_args(tget_capabilities(t
AnsibleModuleNtjsoncCs*i|d6|d6g}t||�}|S(Ntcommandtoutput(R(RtmoduleR
tcmdstbody((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_domain.pytexecute_show_commandas

cCsGg}x:|D]2}t|t�r2|j|�q
|j|�q
W|S(N(t
isinstancetlisttextendtappend(t
command_liststflat_command_listR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_domain.pytflatten_listjs
c
Cs�d}t||d�d}i}|r�d}d}y,tj||tj�}|j�d}Wntk
ryd}nXy,tj||tj�}|j�d}	Wntk
r�d}	nX|	r�|r�|	|d<||d<t|�|d	<q�n|S(
Nsshow vtp statusttextis-.*VTP version running\s+:\s+(?P<version>\d).*s).*VTP Domain Name\s+:\s+(?P<domain>\S+).*tversionttdomaintvtp_password(RtretmatchtDOTALLt	groupdicttAttributeErrortget_vtp_password(
RRRt
vtp_parsedt
version_regextdomain_regext
match_versionRtmatch_domainR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_domain.pytget_vtp_configts,





cCs�d}d}t|�dd}tjd|�r;d}nt|||�d}|dkrr|jdd	�}n6d	}d
}tj||�}|r�|jd�}nt|�S(Nsshow vtp passwordRtdevice_infotnetwork_os_modelsNexus 6RitpasswdRsVTP Password: (\S+)i(R	RtsearchRtgettgrouptstr(RRR
tcapRtpasswordtrptmo((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_domain.pyR#�s	c
Cs�tdtdddt��}|jt�td|dt�}t�}t||�|jd}t|�}|}td|�}t	}td�|j
�D��}tt|j
��j|j
���}	g}
|	r�|
j
dj|�g�nt|
�}|rg|jr)|jd	td
|�qgt}t||�t|�}d|krg|jd�qgni}||d
<||d<||d<||d<||d	<||d<|j|�dS(NRttypeR0trequiredt
argument_spectsupports_check_modecss-|]#\}}|dk	r||fVqdS(N(tNone(t.0tktv((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_domain.pys	<genexpr>�ssvtp domain {0}tchangedtcommandst	configureitproposedtexistingt	end_statetupdatestwarnings(tdicttTruetupdateRR
RRtparamsR)tFalsetitemstsett
differenceRtformatRt
check_modet	exit_jsonRtpop(
R7RRDRRARBtargsR=R@tdeltaR>Rtresults((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_domain.pytmain�sD
		

'	






t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNt&ansible.module_utils.network.nxos.nxosRRRRR	tansible.module_utils.basicR
RRRR)R#RTt__name__(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_domain.pyt<module>s"


			
			2

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