Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/f5/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyc

�
�Udac@`s#ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZydddlm
Z
dd
lmZddlmZddlmZddlmZddlmZWnqek
r9ddlm
Z
dd
lmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZ d$�Z!e"d%kre!�nd&S('i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust	certifiedtsupported_bys
---
module: bigip_device_sshd
short_description: Manage the SSHD settings of a BIG-IP
description:
  - Manage the SSHD settings of a BIG-IP.
version_added: 2.2
options:
  allow:
    description:
      - Specifies, if you have enabled SSH access, the IP address or address
        range for other systems that can use SSH to communicate with this
        system.
      - To specify all addresses, use the value C(all).
      - IP address can be specified, such as 172.27.1.10.
      - IP rangees can be specified, such as 172.27.*.* or 172.27.0.0/255.255.0.0.
      - To remove SSH access specify an empty list or an empty string.
    type: list
  banner:
    description:
      - Whether to enable the banner or not.
    type: str
    choices:
      - enabled
      - disabled
  banner_text:
    description:
      - Specifies the text to include on the pre-login banner that displays
        when a user attempts to login to the system using SSH.
    type: str
  inactivity_timeout:
    description:
      - Specifies the number of seconds before inactivity causes an SSH
        session to log out.
    type: int
  log_level:
    description:
      - Specifies the minimum SSHD message level to include in the system log.
    type: str
    choices:
      - debug
      - debug1
      - debug2
      - debug3
      - error
      - fatal
      - info
      - quiet
      - verbose
  login:
    description:
      - Specifies, when checked C(enabled), that the system accepts SSH
        communications.
    type: str
    choices:
      - enabled
      - disabled
  port:
    description:
      - Port that you want the SSH daemon to run on.
    type: int
notes:
  - Requires BIG-IP version 12.0.0 or greater
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Set the banner for the SSHD service from a string
  bigip_device_sshd:
    banner: enabled
    banner_text: banner text goes here
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Set the banner for the SSHD service from a file
  bigip_device_sshd:
    banner: enabled
    banner_text: "{{ lookup('file', '/path/to/file') }}"
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Set the SSHD service to run on port 2222
  bigip_device_sshd:
    port: 2222
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost
s�
allow:
  description:
    - Specifies, if you have enabled SSH access, the IP address or address
      range for other systems that can use SSH to communicate with this
      system.
  returned: changed
  type: list
  sample: 192.0.2.*
banner:
  description: Whether the banner is enabled or not.
  returned: changed
  type: str
  sample: true
banner_text:
  description:
    - Specifies the text included on the pre-login banner that
      displays when a user attempts to login to the system using SSH.
  returned: changed and success
  type: str
  sample: This is a corporate device. Connecting to it without...
inactivity_timeout:
  description:
    - The number of seconds before inactivity causes an SSH
      session to log out.
  returned: changed
  type: int
  sample: 10
log_level:
  description: The minimum SSHD message level to include in the system log.
  returned: changed
  type: str
  sample: debug
login:
  description: Specifies that the system accepts SSH communications or not.
  returned: changed
  type: bool
  sample: true
port:
  description: Port that you want the SSH daemon to run on.
  returned: changed
  type: int
  sample: 22
(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(t
is_empty_listt
ParameterscB`steZidd6dd6dd6Zddddddd	gZddddddd	gZddddddd	gZRS(
tbanner_textt
bannerTexttinactivity_timeouttinactivityTimeoutt	log_leveltlogLeveltallowtbannertlogintport(t__name__t
__module__tapi_maptapi_attributest
updatablestreturnables(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR�s
t
ApiParameterscB`seZRS((RR(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR �stModuleParameterscB`s5eZed��Zed��Zed��ZRS(cC`s(|jddkrdSt|jd�S(NR(t_valuestNonetint(tself((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR�scC`s(|jddkrdSt|jd�S(NR(R"R#R$(R%((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR�scC`s1|jd}|dkrdSt|�r-gS|S(NR(R"R#R(R%R((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR�s
(RRtpropertyRRR(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR!�stChangescB`seZd�ZRS(cC`s}i}y_xI|jD]>}t||�}t|t�rG|j|�q|||<qW|j|�}Wntk
rxnX|S(N(Rtgetattrt
isinstancetdicttupdatet_filter_paramst	Exception(R%tresultt
returnabletchange((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyt	to_return�s
(RRR1(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR'�st
UsableChangescB`seZRS((RR(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR2�stReportableChangescB`seZRS((RR(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR3�st
DifferencecB`sDeZdd�Zd�Zd�Zed��Zed��ZRS(cC`s||_||_dS(N(twantthave(R%R5R6((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R(tAttributeErrort_Difference__default(R%tparamR.((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pytcompares

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R(R5R6R8(R%R:tattr1tattr2((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyt	__defaults
cC`s�|jjdkrdS|jjsW|jjdkr8dS|jjdk	rW|jjSn|jjdkrs|jjSt|jj�t|jj�kr�|jjSdS(N(R5RR#R6tset(R%((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyRs

$cC`sd|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkr`|jjSdS(Nt(R5RR#R6(R%((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyRs$N(	RRR#R7R;R9R&RR(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR4�s
			t
ModuleManagercB`sYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetR#RBR	RCtclientR!R5R R6R2tchanges(R%targstkwargs((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR7*s
cC`s�t|j|j�}tj}t�}xX|D]P}|j|�}|dkrUq.q.t|t�rt|j	|�q.|||<q.W|r�t
d|�|_tSt
S(NRC(R4R5R6RRR*R;R#R)R+R2RFtTruetFalse(R%tdiffRtchangedtkR0((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyt_update_changed_options1s		
cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRERBt	deprecate(R%R.twarningstwarning((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyt_announce_deprecationsCs


cC`smt�}|j�}td|jj��}|j�}|j|�|jtd|��|j|�|S(NRCRL(R*tpresentR3RFR1R+RV(R%R.RLt
reportableRF((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pytexec_moduleKs	

cC`s
|j�S(N(R+(R%((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyRWWscC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR6t
should_updateRJRBt
check_modeRItupdate_on_device(R%((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR+Zs
cC`s|j�}|rtStS(N(RNRIRJ(R%R.((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR[cscC`s�|jj�}dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ndS(Ns!https://{0}:{1}/mgmt/tm/sys/sshd/tservertserver_porttjsontcodei�tmessage(RFt
api_paramstformatREtprovidertapitpatchR`t
ValueErrorR
tstrtcontent(R%RCturitresptresponsetex((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR]is
cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��nt
d|�S(Ns!https://{0}:{1}/mgmt/tm/sys/sshd/R^R_Rai�RbRC(RdREReRfRDR`RhR
RiRjR (R%RkRlRmRn((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyRZ{s
(RRR7RNRVRYRWR+R[R]RZ(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyRA)s									tArgumentSpeccB`seZd�ZRS(cC`s�ddg|_ddddddd	d
dg	|_t|_tdtd
d�dtd|j�dt�dtd
d�dtd|j�dtd|j�dtd
d��}i|_|jjt�|jj|�dS(Ntenabledtdisabledtdebugtdebug1tdebug2tdebug3terrortfataltinfotquiettverboseRttypetlistRtchoicesRRR$RRR(R}tlevelsRItsupports_check_modeR*t
argument_specR+R
(R%R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyR7�s*					(RRR7(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyRo�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�RRBRP(
RoRR�RRARYt	exit_jsonR
t	fail_jsonRi(tspecRBtmmtresultsRn((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pytmain�s		t__main__N(#t
__future__RRRR{t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt%library.module_utils.network.f5.bigipR	t&library.module_utils.network.f5.commonR
RRR
RtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR R!R'R2R3tobjectR4RARoR�R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_sshd.pyt<module>sD


E-
-e"	

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