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

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZmZd	dlm	Z	m
Z
d	d
lmZd�Z
d�Zd�Zd�Zd�Zedkr�e�nd
S(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys|
---
module: nxos_gir
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Trigger a graceful removal or insertion (GIR) of the switch.
description:
    - Trigger a graceful removal or insertion (GIR) of the switch.
author:
    - Gabriele Gerbino (@GGabriele)
notes:
    - Tested against NXOSv 7.3.(0)D1(1) on VIRL
    - C(state) has effect only in combination with
      C(system_mode_maintenance_timeout) or
      C(system_mode_maintenance_on_reload_reset_reason).
    - Using C(system_mode_maintenance) and
      C(system_mode_maintenance_dont_generate_profile) would make the module
      fail, but the system mode will be triggered anyway.
options:
    system_mode_maintenance:
        description:
            - When C(system_mode_maintenance=true) it puts all enabled
              protocols in maintenance mode (using the isolate command).
              When C(system_mode_maintenance=false) it puts all enabled
              protocols in normal mode (using the no isolate command).
        type: bool
    system_mode_maintenance_dont_generate_profile:
        description:
            - When C(system_mode_maintenance_dont_generate_profile=true) it
              prevents the dynamic searching of enabled protocols and executes
              commands configured in a maintenance-mode profile.
              Use this option if you want the system to use a maintenance-mode
              profile that you have created.
              When C(system_mode_maintenance_dont_generate_profile=false) it
              prevents the dynamic searching of enabled protocols and executes
              commands configured in a normal-mode profile. Use this option if
              you want the system to use a normal-mode profile that
              you have created.
        type: bool
    system_mode_maintenance_timeout:
        description:
            - Keeps the switch in maintenance mode for a specified
              number of minutes. Range is 5-65535.
    system_mode_maintenance_shutdown:
        description:
            - Shuts down all protocols, vPC domains, and interfaces except
              the management interface (using the shutdown command).
              This option is disruptive while C(system_mode_maintenance)
              (which uses the isolate command) is not.
        type: bool
    system_mode_maintenance_on_reload_reset_reason:
        description:
            - Boots the switch into maintenance mode automatically in the
              event of a specified system crash. Note that not all reset
              reasons are applicable for all platforms. Also if reset
              reason is set to match_any, it is not idempotent as it turns
              on all reset reasons. If reset reason is match_any and state
              is absent, it turns off all the reset reasons.
        choices: ['hw_error','svc_failure','kern_failure','wdog_timeout',
                  'fatal_error','lc_failure','match_any','manual_reload',
                  'any_other', 'maintenance']
    state:
        description:
            - Specify desired state of the resource.
        required: true
        default: present
        choices: ['present','absent']
s�
# Trigger system maintenance mode
- nxos_gir:
    system_mode_maintenance: true
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
# Trigger system normal mode
- nxos_gir:
    system_mode_maintenance: false
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
# Configure on-reload reset-reason for maintenance mode
- nxos_gir:
    system_mode_maintenance_on_reload_reset_reason: manual_reload
    state: present
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
# Add on-reload reset-reason for maintenance mode
- nxos_gir:
    system_mode_maintenance_on_reload_reset_reason: hw_error
    state: present
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
# Remove on-reload reset-reason for maintenance mode
- nxos_gir:
    system_mode_maintenance_on_reload_reset_reason: manual_reload
    state: absent
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
# Set timeout for maintenance mode
- nxos_gir:
    system_mode_maintenance_timeout: 30
    state: present
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
# Remove timeout for maintenance mode
- nxos_gir:
    system_mode_maintenance_timeout: 30
    state: absent
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
s�
final_system_mode:
    description: describe the last system mode
    returned: verbose mode
    type: str
    sample: normal
updates:
    description: commands sent to the device
    returned: verbose mode
    type: list
    sample: ["terminal dont-ask", "system mode maintenance timeout 10"]
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(tget_capabilitiestnxos_argument_spec(t
AnsibleModulecCsUidd6dd6}t||g�d}|rKd|j�krKd}nd}|S(Nsshow system modetcommandttexttoutputitnormaltmaintenance(Rtlower(tmoduleRtbodytmode((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir.pytget_system_mode�s	cCs>idd6dd6}t||g�d}|j�d}|S(Nsshow maintenance timeoutRRR
ii(Rtsplit(RRRttimeout((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir.pytget_maintenance_timeout�scCs.idd6dd6}t||g�d}|S(Ns(show maintenance on-reload reset-reasonsRRR
i(R(RRR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir.pytget_reset_reasons�scCs�t�}d}|jdtkr>|dkr>|jd�n1|jdtkrm|dkrm|jd�n|jdtkr�|dkr�|jd�n�|jdtkr�|dkr�|jd	�n�|jd
ret|�}|dkr#||jd
kr#|jdj|jd
��qo|d
kro||jd
kro|jdj|jd
��qon
|jdr�|dkr�|jd�n�|jdtkr�|dkr�|jd�n�|jdrot|�}|dkr!|jdj�|j�kr!|jdj|jd��qo|d
kro|jdj�|j�kro|jdj|jd��qon|r�|j	dd�n|S(Nttsystem_mode_maintenanceRssystem mode maintenanceRsno system mode maintenancet-system_mode_maintenance_dont_generate_profiles-system mode maintenance dont-generate-profiles0no system mode maintenance dont-generate-profiletsystem_mode_maintenance_timeouttpresents#system mode maintenance timeout {0}tabsents&no system mode maintenance timeout {0}t system_mode_maintenance_shutdowns system mode maintenance shutdownt.system_mode_maintenance_on_reload_reset_reasons2system mode maintenance on-reload reset-reason {0}s5no system mode maintenance on-reload reset-reason {0}isterminal dont-ask(
tlisttparamstTruetappendtFalseRtformatRRtinsert(RtstateRtcommandstsystem_modeRt
reset_reasons((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir.pytget_commands�sb	






c	Cs�tdtdtdd�dtdtdd�dtdtdd�dtdtdd�d	tdtd
ddd
dddddddg
�dtd
dddgdddt��}|jt�td|dddddd	ggdddddd	ggdt�}t�}|jd}t|�}t	|||�}t}|r~|j
rh|jdtd|�q~t||�t}ni}||d<|j
dkr�t|�}||d <||d!<n||d"<|j|�dS(#NRtrequiredttypetboolRRtstrRR tchoicesthw_errortsvc_failuretkern_failuretwdog_timeouttfatal_errort
lc_failuret	match_anyt
manual_reloadt	any_otherRR(RRtdefaultt
argument_spectmutually_exclusivetrequired_one_oftsupports_check_modetchangedR)itfinal_system_modetupdatestwarnings(tdictR%tupdateR	R
R#R!R"RR,t
check_modet	exit_jsonRt
_verbosity(	R<RRCR(RR)R@tresultRA((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir.pytmain�sX				
		
	
	



t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtret&ansible.module_utils.network.nxos.nxosRRRRR	tansible.module_utils.basicR
RRRR,RJt__name__(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_gir.pyt<module>s 


F2	
			;	<

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