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

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZyDddlmZddlmZddlmZddlmZWnQek
r1ddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ de!fd ��YZ"d!e!fd"��YZ#d#e!fd$��YZ$d%�Z%e&d&kre%�ndS('i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_byss
---
module: bigip_software_install
short_description: Install software images on a BIG-IP
description:
  - Install new images on a BIG-IP.
version_added: 2.7
options:
  image:
    description:
      - Image to install on the remote device.
    type: str
  volume:
    description:
      - The volume to install the software image to.
    type: str
  state:
    description:
      - When C(installed), ensures that the software is installed on the volume
        and the volume is set to be booted from. The device is B(not) rebooted
        into the new software.
      - When C(activated), performs the same operation as C(installed), but
        the system is rebooted to the new software.
    type: str
    choices:
      - activated
      - installed
    default: activated
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s.
- name: Ensure an existing image is installed in specified volume
  bigip_software_install:
    image: BIGIP-13.0.0.0.0.1645.iso
    volume: HD1.2
    state: installed
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Ensure an existing image is activated in specified volume
  bigip_software_install:
    image: BIGIP-13.0.0.0.0.1645.iso
    state: activated
    volume: HD1.2
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s
# only common fields returned
N(tURLError(turlparse(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spect
ParameterscB`s&eZiZddgZgZgZRS(toptionstvolume(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR_s
	t
ApiParameterscB`s eZed��Zd�ZRS(cC`s0g}||jd�7}||jd�7}|S(Ntimagethotfix(tread_image_from_device(tselftresult((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pytimage_namessscC`s�dj|jjd|jjd|�}|jjj|�}y|j�}Wntk
rbgSXd|kr�|ddkr�d|kr�gSgSnd|kr�gSg|dD]}|djd	�d
^q�S(Ns(https://{0}:{1}/mgmt/tm/sys/software/{2}tservertserver_porttcodei�tmessagetitemstnamet/i(tformattclienttprovidertapitgettjsont
ValueErrortsplit(Rttturitresptresponsetx((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRzs 

	
(RRtpropertyRR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRrstModuleParameterscB`sVeZed��Zed��Zed��Zed��Zd�Zd�ZRS(cC`s7|jdr|jdS|jd|jd<|jdS(Ntversion(t_valuest
image_info(R((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR5�s
cC`s7|jdr|jdS|jd|jd<|jdS(Ntbuild(R6R7(R((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR8�s
cC`s:|jdr|jd}n|j�}||jd<|S(NR7(R6t
read_image(RR((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR7�s


cC`sS|jdr|jdSd|jdkr;d|jd<n
d|jd<|jdS(Nt
image_typessoftware:imagetkindRR(R6R7(R((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR:�s

cC`s<|jdd�}|r|S|jdd�}|r8|SdS(NttypeRR(RtNone(RR((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR9�scC`s�dj|jjd|jjd|�}|jjj|�}y|j�}Wn%tk
ru}tt|���nXd|kr�x/|dD] }|dj	|j
�r�|Sq�WndS(Ns)https://{0}:{1}/mgmt/tm/sys/software/{2}/RR R#R$(R&R'R(R)R*R+R,Rtstrt
startswithR(RR<R/R0R1textitem((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR�s

	(	RRR3R5R8R7R:R9R(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR4�s


		tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(RRt
returnable((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt	to_return�s
(RRRG(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRB�st
UsableChangescB`seZRS((RR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRH�stReportableChangescB`seZRS((RR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRI�st
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(RRKRL((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RCtAttributeErrort_Difference__default(RtparamR((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RCRKRLRN(RRPtattr1tattr2((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt	__default�s
N(RRR=RMRQRO(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRJ�s	t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�ZRS(cO`sy|jdd�|_t|jj�|_td|jjd|j�|_td|j�|_	t
�|_d|_dS(NtmoduletparamsR'(
R*R=RVRRWR'R4RKRRLRHtchangest
volume_url(Rtargstkwargs((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRM�s!cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRW(RRRCRKR=RHRX(Rtchangedtkey((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt_set_changed_optionss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(NRW(RJRKRLRRtdictRQR=t
isinstancetupdateRHRXtTruetFalse(RtdiffRR\tktchange((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt_update_changed_optionss		
cC`s|j�}|rtStS(N(RgRbRc(RR((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt
should_update scC`smt�}|j�}td|jj��}|j�}|j|�|jtd|��|j|�|S(NRWR\(R_tpresentRIRXRGRat_announce_deprecations(RRR\t
reportableRX((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pytexec_module&s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgR5(tpopR'RVt	deprecate(RRtwarningstwarning((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRj2s


cC`s|j�rtS|j�SdS(N(texistsRcRa(R((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRi:scC`sCt|d�j}dj|jjd|jjd|�|_dS(NtselfLinkshttps://{0}:{1}{2}RR (R	tpathR&R'R(RY(RRARu((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt_set_volume_url@s


cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wntk
r_tSXx<|dD]0}|dj|j	j
�rk|j|�PqkqkW|js�||j	j
|_n|jjj|j�}y|j�}Wntk
r�tSX|j
dks&d|kr*|ddkr*tS|j	j|jdd�krLtS|j	j|jd	d�krntS|j	jd
kr�tS|j	jdkr�d|d
dkr�tSntS(Ns,https://{0}:{1}/mgmt/tm/sys/software/volume/RR R#R$i�R!R5R8t	installedt	activatedtdefaultBootLocationtmediai(R&R'R(R)R*R+R,RcR?RKRRvRYRR5R=R8tstateRb(RR/R0t
collectionRAR1((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRsHs>


	
+cC`sp|jjj|j�}y|j�}Wntk
r<tSX|jdkshd|krl|ddkrltStS(Ni�R!(	R'R)R*RYR+R,RcRRb(RR0R1((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt
volume_existsts
+cC`s�|jjrtS|jjrC|jj|jjkrCtd��nt�}|j	�so|j
itd6�n|jjdkr�|j
itd6�n|jji|d6�|j
�|j�|jjdkr�|j�ntS(Ns0The specified image was not found on the device.s
create-volumeRxtrebootR(RVt
check_modeRbRKRRLRRtlistR}tappendR{Ratupdate_on_devicet#wait_for_software_install_on_devicetwait_for_device_reboot(RR((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRas $	


cC`s>idd6|jjd6}|j|jj��dj|jjd|jjd|jj�}|jjj	|d|�}yK|j
�}d|kr�t|dj��d	kr�t
|d��nWn%tk
r�}t
t|���nXd
|kr:|d
dkr:d
|kr(t
|d
��q:t
|j��ntS(NtinstalltcommandR$s(https://{0}:{1}/mgmt/tm/sys/software/{2}RR R+t
commandResultiR!i�i�R"(i�i�(RKRRat
api_paramsR&R'R(R:R)tpostR+tlentstripRR,R>tcontentRb(RRWR/R0R1R@((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR��s(

(cC`s�xztr|tjd�yO|jj�|j�}|dkrDwnd|krd|dtkrdPnWqtk
rxqXqWdS(Nitactive(RbttimetsleepR't	reconnecttread_volume_from_deviceR=R(RR((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR��s	


cC`s�xItd�D];}y|j�r&PnWntk
r:nXtjd�q
Wx{tr�tjd�|j�}|dks�d|kr�|jj	�qOn|ddkr�PqO|ddkrOt�qOqOWdS(Ni
iRtcompletetfailed(
trangeR}RR�R�RbR�R=R'R�(RtdummyR((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR��s"
	

cC`s�y(|jjj|j�}|j�}WnJtk
rO}tt|���n&tj	k
rcdStk
rtdSXd|kr�|ddkr�d|kr�t|d��q�t|j��n|S(NR!i�R"(
R'R)R*RYR+R,RR>tssltSSLErrorR=RR�(RR0R1R@((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR��s
(RRRMR^RgRhRlRjRiRvRsR}RaR�R�R�R�(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRU�s									,					tArgumentSpeccB`seZd�ZRS(cC`slt|_tdt�dt�dtdddddg��}i|_|jjt�|jj|�dS(NRRR{tdefaultRxtchoicesRw(Rbtsupports_check_modeR_t
argument_specRaR(RR�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyRM�s				(RRRM(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RVRn(
R�R
R�R�RURlt	exit_jsonRt	fail_jsonR>(tspecRVtmmtresultsR@((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pytmain�s		t__main__('t
__future__RRRR<t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR�R�t+ansible.module_utils.six.moves.urllib.errorRtansible.module_utils.urlsR	tansible.module_utils.basicR
t%library.module_utils.network.f5.bigipRt&library.module_utils.network.f5.commonRR
RtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRRR4RBRHRItobjectRJRUR�R�R(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_software_install.pyt<module>sD


"
C�	

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