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

�
�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_bys�
---

module: nxos_vtp_version
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages VTP version configuration.
description:
    - Manages VTP version 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 version.
    - Use this in combination with M(nxos_vtp_password) and M(nxos_vtp_version)
      to fully manage VTP operations.
options:
    version:
        description:
            - VTP version number.
        required: true
        choices: ['1', '2']
s�
# ENSURE VTP VERSION IS 2
- nxos_vtp_version:
    version: 2
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
s�
proposed:
    description: k/v pairs of parameters passed into module
    returned: always
    type: dict
    sample: {"version": "2"}
existing:
    description:
        - k/v pairs of existing vtp
    returned: always
    type: dict
    sample: {"domain": "testing", "version": "1", "vtp_password": ""}
end_state:
    description: k/v pairs of vtp after module execution
    returned: always
    type: dict
    sample: {"domain": "testing", "version": "2", "vtp_password": ""}
updates:
    description: command sent to the device
    returned: always
    type: list
    sample: ["vtp version 2"]
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((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_version.pytexecute_show_command\s

cCsGg}x:|D]2}t|t�r2|j|�q
|j|�q
W|S(N(t
isinstancetlisttextendtappend(t
command_liststflat_command_listR((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_version.pytflatten_listes
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((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_version.pytget_vtp_configos,





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((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_version.pyR#�s	c
	Cs�tdtdddddgdt��}|jt�td|d	t�}t�}t||�|jd}t|�}|}td|�}t	}td
�|j
�D��}tt|j
��j|j
���}	g}
|	r|
j
dj|�g�nt|
�}|rs|jr5|jdtd
|�qst}t||�t|�}d|krs|jd�qsni}||d<||d<||d<||d<||d<||d<|j|�dS(NRttypeR0tchoicest1t2trequiredt
argument_spectsupports_check_modecss-|]#\}}|dk	r||fVqdS(N(tNone(t.0tktv((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_version.pys	<genexpr>�ssvtp version {0}tchangedtcommandst	configureitproposedtexistingt	end_statetupdatestwarnings(tdicttTruetupdateRR
RRtparamsR)tFalsetitemstsett
differenceRtformatRt
check_modet	exit_jsonRtpop(
R:RRGRRDREtargsR@RCtdeltaRARtresults((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_vtp_version.pytmain�sD$
		

'	






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


		
			2

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