Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/ios/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/ios/ios_banner.pyo

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lmZd	dlmZd	dlm	Z	d	d
lm
Z
mZd	dlZd�Z
d�Zd�Zd�Zedkr�e�ndS(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bysf
---
module: ios_banner
version_added: "2.3"
author: "Ricardo Carrillo Cruz (@rcarrillocruz)"
short_description: Manage multiline banners on Cisco IOS devices
description:
  - This will configure both login and motd banners on remote devices
    running Cisco IOS.  It allows playbooks to add or remote
    banner text from the active running configuration.
extends_documentation_fragment: ios
notes:
  - Tested against IOS 15.6
options:
  banner:
    description:
      - Specifies which banner should be configured on the remote device.
        In Ansible 2.4 and earlier only I(login) and I(motd) were supported.
    required: true
    choices: ['login', 'motd', 'exec', 'incoming', 'slip-ppp']
  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']
s�
- name: configure the login banner
  ios_banner:
    banner: login
    text: |
      this is my login banner
      that contains a multiline
      string
    state: present

- name: remove the motd banner
  ios_banner:
    banner: motd
    state: absent

- name: Configure banner from file
  ios_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 login
    - this is my login banner
    - that contains a multiline
    - string
i����(t
AnsibleModule(texec_command(tload_config(tios_argument_spect
check_argsNcCs�t�}|\}}|jd}|dkred|j�kre|dre|jd|jd�n{|dkr�|dr�|d|jd�kr�d|jd}|d7}||dj�7}|d	7}|j|�q�n|S(
Ntstatetabsentttextsno banner %stbannertpresents	banner %ss @
s
@(tlisttparamstkeystappendtgettstrip(tupdatestmoduletcommandstwantthaveR
t
banner_cmd((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_banner.pytmap_obj_to_commandsbs	
(#

cCs�t|d|jd�\}}}|dkr8|}nYt|d|jd�\}}}|r�tjd|tj�jd�j�}nd}i|jdd6dd6}|r�||d	<d
|d<n|S(Nsshow banner %sR
is%show running-config | begin banner %ss\^C(.*?)\^CiRR
RR(RRtretsearchtStgroupRtNone(Rtrctoutterrtoutputtobj((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_banner.pytmap_config_to_objus#	*

cCsO|jd}|r(t|�j�}ni|jdd6|d6|jdd6S(NRR
R
(RtstrR(RR((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_banner.pytmap_params_to_obj�s
cCs5tdtdtddddddg�d	t�d
tddddd
g��}|jt�d
ddfg}td|d|dt�}t�}t||�itd6}|r�||d<nt|�}t	|�}t
||f|�}||d<|r$|jst||�nt|d<n|j
|�dS(s+ main entry point for module execution
    R
trequiredtchoicestlogintmotdtexectincomingsslip-pppRR
tdefaultRRt
argument_spectrequired_iftsupports_check_modetchangedtwarningsRN(R(tdicttTruetupdateRRRR	tFalseR(R&Rt
check_modeRt	exit_json(R0R1RR4tresultRRR((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_banner.pytmain�s.$	
		



	
t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.connectionRt$ansible.module_utils.network.ios.iosRRR	RRR&R(R<t__name__(((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_banner.pyt<module>s 


"				&

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