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

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lmZd	dlmZmZd	dlm	Z	m
Z
d	d
lZd�Zd�Z
d�Zd�Zd�Zedkr�e�nd
S(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys�
---
module: nxos_banner
version_added: "2.4"
author: "Trishna Guha (@trishnaguha)"
short_description: Manage multiline banners on Cisco NXOS devices
description:
  - This will configure both exec and motd banners on remote devices
    running Cisco NXOS. It allows playbooks to add or remote
    banner text from the active running configuration.
options:
  banner:
    description:
      - Specifies which banner that should be
        configured on the remote device.
    required: true
    choices: ['exec', 'motd']
  text:
    description:
      - The banner text that should be
        present in the remote device running configuration. This argument
        accepts a multiline string, with no empty lines. Requires I(state=present).
  state:
    description:
      - Specifies whether or not the configuration is present in the current
        devices active running configuration.
    default: present
    choices: ['present', 'absent']
extends_documentation_fragment: nxos
s�
- name: configure the exec banner
  nxos_banner:
    banner: exec
    text: |
      this is my exec banner
      that contains a multiline
      string
    state: present
- name: remove the motd banner
  nxos_banner:
    banner: motd
    state: absent
- name: Configure banner from file
  nxos_banner:
    banner:  motd
    text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"
    state: present
s�
commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  type: list
  sample:
    - banner exec
    - this is my exec banner
    - that contains a multiline
    - string
i����(t
AnsibleModule(tload_configtrun_commands(tnxos_argument_spect
check_argsNcCs0d}i|d6|d6g}t||�}|S(Nttexttcommandtoutput(R(tmoduleRtformattcmdsR((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_banner.pytexecute_show_command_s
cCs�t�}|jd}d}|dkr�|jd�r�|jd�dkpdtj||jd��r�|jd|jd�q�n[|dkr�|jd�|jd�kr�d	|jd|dj�f}|j|�n|S(
Ntstates
Nexus.*SwitchtabsentR
sUser Access Verificationsno banner %stbannertpresentsbanner %s @
%s
@(tlisttparamstgettretmatchtappendtstrip(twantthaveR
tcommandsRtplatform_regext
banner_cmd((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_banner.pytmap_obj_to_commandsis	
@*!cCsd|jd}t||�d}d|krN|jdd|jd�nt|t�r�t|j��}|gkr�|d}nd}t|t�r�t|j��}|gkr�|d}q�d}q�n|j�}i|jdd6dd	6}|r||d
<d|d	<n|S(Nsshow banner %sRisInvalid commandtmsgsTbanner: %s may not be supported on this platform.  Possible values are : exec | motdtRRR
R(RRt	fail_jsont
isinstancetdictRtvaluestrstrip(R
RRtobj((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_banner.pytmap_config_to_objys(



cCsO|jd}|r(t|�j�}ni|jdd6|d6|jdd6S(NR
RR(RtstrR(R
R
((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_banner.pytmap_params_to_obj�s
cCs�tdtdtdddg�dt�dtdd	dd	d
g��}|jt�dd	dfg}td|d|d
t�}t�}t||�itd6}|r�||d<nt|�}t	|�}t
|||�}||d<|r�|js}t||t�}|r}xd|D]Y}	|	rt
|	t�rB|	d}
n|	}
d|
ks`d|
krst||�qsqqWq}nt|d<n|j|�dS(s+ main entry point for module execution
    RtrequiredtchoicestexectmotdR
RtdefaultRRt
argument_spectrequired_iftsupports_check_modetchangedtwarningsRtclierrorsmore than 40 linessbuffer overflowedN(R
(R&tTruetupdateRRRR	tFalseR,R*R!t
check_modeRR%t	exit_json(R2R3R
R6tresultRRRtmsgstitemterr_str((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_banner.pytmain�s>	
		



	


t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt&ansible.module_utils.network.nxos.nxosRRRR	RRR!R*R,RAt__name__(((sL/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_banner.pyt<module>s 


	
				/

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