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

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZmZd	dlm	Z	d	d
l
mZd	dlm
Z
d�Zd�Zd�Zd�Zd�Zedkr�e�nd
S(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys�
---
module: nxos_gir_profile_management
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Create a maintenance-mode or normal-mode profile for GIR.
description:
    - Manage a maintenance-mode or normal-mode profile with configuration
      commands that can be applied during graceful removal
      or graceful insertion.
author:
    - Gabriele Gerbino (@GGabriele)
notes:
    - Tested against NXOSv 7.3.(0)D1(1) on VIRL
    - C(state=absent) removes the whole profile.
options:
    commands:
        description:
            - List of commands to be included into the profile.
    mode:
        description:
            - Configure the profile as Maintenance or Normal mode.
        required: true
        choices: ['maintenance', 'normal']
    state:
        description:
            - Specify desired state of the resource.
        default: present
        choices: ['present','absent']
s�
# Create a maintenance-mode profile
- nxos_gir_profile_management:
    mode: maintenance
    commands:
      - router eigrp 11
      - isolate

# Remove the maintenance-mode profile
- nxos_gir_profile_management:
    mode: maintenance
    state: absent
s�
proposed:
    description: list of commands passed into module.
    returned: verbose mode
    type: list
    sample: ["router eigrp 11", "isolate"]
existing:
    description: list of existing profile commands.
    returned: verbose mode
    type: list
    sample: ["router bgp 65535","isolate","router eigrp 10","isolate",
            "diagnostic bootup level complete"]
end_state:
    description: list of profile entries after module execution.
    returned: verbose mode
    type: list
    sample: ["router bgp 65535","isolate","router eigrp 10","isolate",
            "diagnostic bootup level complete","router eigrp 11", "isolate"]
updates:
    description: commands sent to the device
    returned: always
    type: list
    sample: ["configure maintenance profile maintenance-mode",
             "router eigrp 11","isolate"]
changed:
    description: check to see if a change was made on the device
    returned: always
    type: bool
    sample: true
i����N(t
get_configtload_configtrun_commands(tnxos_argument_spec(t
AnsibleModule(tCustomNetworkConfigcCs�g}tdddt|��}|jddkr@dg}n	dg}|j|�}|r�|j�}g|D]}|j�^qq}|jd�n|S(	Ntindentitcontentstmodetmaintenances.configure maintenance profile maintenance-modes)configure maintenance profile normal-modei(R
Rtparamstget_sectiont
splitlineststriptpop(tmoduletexistingtnetcfgtparentstconfigtcmd((s\/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir_profile_management.pytget_existingls	cCs`t�}||kr|S|j|�|jddkrL|jdd�n|jdd�|S(NR
Ris.configure maintenance profile maintenance-modes)configure maintenance profile normal-mode(tlisttextendRtinsert(RRtcommandstcmds((s\/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir_profile_management.pyt
state_present~s	
cCs,|jddkrdg}n	dg}|S(NR
Rs1no configure maintenance profile maintenance-modes,no configure maintenance profile normal-mode(R(RRRR((s\/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir_profile_management.pytstate_absent�s	cOs)t�j|�}|r%|||�SdS(N(tglobalstget(tnametargstkwargstfunc((s\/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir_profile_management.pytinvoke�sc
Cs�tdtdtdd�dtdtdddg�d	tdd
dgdd��}|jt�td
|dt�}t�}|jd	}|jdp�g}|d
kr�|r�|jdd�nt	d|�}|}t}i}g}	|dks	|d
krr|rrt	d||||�}	|j
rD|jdtd|	�qr|	rrt||	�t}t	d|�}qrn||d<|j
dkr�t	d|�}||d<||d<||d<|	|d<n||d<|j|�dS(NRtrequiredttypeRR
tchoicesRtnormaltstatetabsenttpresenttdefaultt
argument_spectsupports_check_modetmsgs-when state is absent, no command can be used.Rsstate_%stchangedit	end_stateRtproposedtupdatestwarnings(tdicttFalsetTruetupdateRR	RRt	fail_jsonR(t
check_modet	exit_jsonRt
_verbosity(
R1RR8R-RRR5R4tresultR((s\/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir_profile_management.pytmain�sD
		
	






t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtret&ansible.module_utils.network.nxos.nxosRRRRtansible.module_utils.basicR	t*ansible.module_utils.network.common.configR
RR R!R(RBt__name__(((s\/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir_profile_management.pyt<module>s"


 					2

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