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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	yddl
m
Z
Wn!ek
r�ddlm
Z
nXddl
Z
ddlZdd
lmZydddlmZddlmZddlmZddlmZddlmZddlmZWnqek
r�ddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZ d�Z!e"dkr�e!�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_config
short_description: Manage BIG-IP configuration sections
description:
  - Manages a BIG-IP configuration by allowing TMSH commands that
    modify running configuration, or merge SCF formatted files into
    the running configuration. Additionally, this module is of
    significant importance because it allows you to save your running
    configuration to disk. Since the F5 module only manipulate running
    configuration, it is important that you utilize this module to save
    that running config.
version_added: 2.4
options:
  save:
    description:
      - The C(save) argument instructs the module to save the
        running-config to startup-config.
      - This operation is performed after any changes are made to the
        current running config. If no changes are made, the configuration
        is still saved to the startup config.
      - This option will always cause the module to return changed.
    type: bool
    default: yes
  reset:
    description:
      - Loads the default configuration on the device.
      - If this option is specified, the default configuration will be
        loaded before any commands or other provided configuration is run.
    type: bool
    default: no
  merge_content:
    description:
      - Loads the specified configuration that you want to merge into
        the running configuration. This is equivalent to using the
        C(tmsh) command C(load sys config from-terminal merge).
      - If you need to read configuration from a file or template, use
        Ansible's C(file) or C(template) lookup plugins respectively.
    type: str
  verify:
    description:
      - Validates the specified configuration to see whether they are
        valid to replace the running configuration.
      - The running configuration will not be changed.
      - When this parameter is set to C(yes), no change will be reported
        by the module.
    type: bool
    default: no
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s�
- name: Save the running configuration of the BIG-IP
  bigip_config:
    save: yes
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost

- name: Reset the BIG-IP configuration, for example, to RMA the device
  bigip_config:
    reset: yes
    save: yes
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost

- name: Load an SCF configuration
  bigip_config:
    merge_content: "{{ lookup('file', '/path/to/config.scf') }}"
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
s
stdout:
  description: The set of responses from the options
  returned: always
  type: list
  sample: ['...', '...']
stdout_lines:
  description: The value of stdout split into a list
  returned: always
  type: list
  sample: [['...', '...'], ['...'], ['...']]
(tStringION(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(tupload_filet
ParameterscB`seZddgZd�ZRS(tstdouttstdout_linescC`s@i}x$|jD]}t||�||<qW|j|�}|S(N(treturnablestgetattrt_filter_params(tselftresultt
returnable((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyt	to_return�s
(t__name__t
__module__RR(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR�st
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
d�Ze
d	�Zd
�Z
d�Zd�Zd
�Zd�ZRS(cO`sR|jdd�|_t|jj�|_td|jj�|_t�|_dS(Ntmoduletparams(	tgettNoneRR
RtclientRtwanttchanges(Rtargstkwargs((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyt__init__�scC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR(RRRR"R R#(Rtchangedtkey((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyt_set_changed_options�scC`sRt�}xB|D]:}t|t�r=t|�jd�}n|j|�qW|S(Ns
(tlistt
isinstancetstrtsplittappend(RRtlinestitem((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyt	_to_lines�s	
cC`sBi}|j�}|j|jj��|jtd|��|S(NR'(texecutetupdateR#Rtdict(RRR'((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pytexec_module�s
cC`sg}|jjr.|j�}|j|�n|jjr�|jjrh|jdt�}|j|�q�|jdt�}|j|�n|jjr�|j�}|j|�n|j	|�i|d6|j
|�d6}td|�|_|jjr�tStS(NtverifyRRR(
R"tresetR.t
merge_contentR6tmergetTruetFalsetsavet_detect_errorsR1RR#(Rt	responsestresponseR#((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR2�s*
cC`s]dg}g|D]%}|D]}||kr|^qq}|rYtdj|���ndS(NsUnexpected Error:t (Rtjoin(RRterrorstxtytmsg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR=�s	2cC`s|jjrtS|j�S(N(Rt
check_modeR:treset_device(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR7�scC`sd}dj|jjd|jjd�}tddddj|��}|jjj|d	|�}y|j�}Wn%tk
r�}tt	|���nXd
|kr�|d
dkr�d|kr�t|d��q�t|j
��nd
|krt	|d
�SdS(Nstmsh load sys config defaults!https://{0}:{1}/mgmt/tm/util/bashtservertserver_porttcommandtruntutilCmdArgss-c "{0}"tjsontcodei�tmessaget
commandResult(tformatR!tproviderR4tapitpostRMt
ValueErrorRR,tcontent(RRJturiR$trespR?tex((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyRG�s$
cC`s�ttj��}dj|�}d|}|jjr;tS|j|�|j|�|j	d|d|�}|j
d|�|S(Ns/var/config/rest/downloads/{0}s/tmp/tremote_pathR6(tnextttempfilet_get_candidate_namesRQRRFR:tupload_to_devicetmove_on_devicetmerge_on_devicetremove_temporary_file(RR6t	temp_nameRZt	temp_pathR?((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR9�s


	c	C`s$dj|�}|r"|d7}ndj|jjd|jjd�}tdddd	j|��}|jjj|d
|�}y|j�}Wn%tk
r�}tt	|���nXd|kr|ddkrd
|kr�t|d
��qt|j
��nd|kr t	|d�SdS(Ns#tmsh load sys config file {0} merges verifys!https://{0}:{1}/mgmt/tm/util/bashRHRIRJRKRLs-c "{0}"RMRNi�RORP(RQR!RRR4RSRTRMRURR,RV(	RRZR6RJRWR$RXR?RY((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR`	s*	

cC`s�dj|jjd|jjd�}tddd|�}|jjj|d|�}y|j�}Wn%tk
r�}tt	|���nXd|kr�|dd	kr�d
|kr�t|d
��q�t|j
��ndS(Ns$https://{0}:{1}/mgmt/tm/util/unix-rmRHRIRJRKRLRMRNi�RO(RQR!RRR4RSRTRMRURR,RV(RRZRWR$RXR?RY((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyRa(s
	cC`s�dj|jjd|jjd�}tddddj|tjj|���}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd	|kr�|d	d
kr�d|kr�t|d��q�t|j
��ndS(Ns$https://{0}:{1}/mgmt/tm/util/unix-mvRHRIRJRKRLs{0} /tmp/{1}RMRNi�RO(RQR!RRR4tostpathtbasenameRSRTRMRURR,RV(RRZRWR$RXR?RY((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR_>s 
cC`svt|jj�}dj|jjd|jjd�}yt|j|||�Wntk
rqtd��nXdS(Ns1https://{0}:{1}/mgmt/shared/file-transfer/uploadsRHRIsFailed to upload the file.(RR"R8RQR!RRRR(RRbttemplateturl((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR^Vs

cC`s|jjrtS|j�S(N(RRFR:tsave_on_device(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR<cscC`sd}dj|jjd|jjd�}tddddj|��}|jjj|d	|�}y|j�}Wn%tk
r�}tt	|���nXd
|kr�|d
dkr�d|kr�t|d��q�t|j
��nd
|krt	|d
�SdS(Nstmsh save sys configs!https://{0}:{1}/mgmt/tm/util/bashRHRIRJRKRLs-c "{0}"RMRNi�RORP(RQR!RRR4RSRTRMRURR,RV(RRJRWR$RXR?RY((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyRihs$
(RRR&R)R1R5R2R=R7RGR:R9R`RaR_R^R<Ri(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR�s							
					
	tArgumentSpeccB`seZd�ZRS(c
C`s�t|_tdtdddt�dt�dtdddt�dtdddd��}i|_|jjt�|jj|�dS(	NR7ttypetbooltdefaultR8R6R<tyes(R:tsupports_check_modeR4R;t
argument_specR3R(RRp((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyR&�s					(RRR&(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyRj�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NRpRoRRE(
RjR	RpRoRR5t	exit_jsonRt	fail_jsonR,(tspecRtmmtresultsRY((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pytmain�s		t__main__(#t
__future__RRRRkt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRtImportErrortioRdR\tansible.module_utils.basicR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
Rt(library.module_utils.network.f5.icontrolRt%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont(ansible.module_utils.network.f5.icontrolRtobjectRRjRvR(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_config.pyt<module>sD


5


�	

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