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/bigiq_regkey_license.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZyDdd
l
mZddlmZddlmZddlmZWnQek
rdd
lmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZd!efd"��YZd#�Z e!d$kr�e �ndS(%i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigiq_regkey_license
short_description: Manages licenses in a BIG-IQ registration key pool
description:
  - Manages licenses in a BIG-IQ registration key pool.
version_added: 2.5
options:
  regkey_pool:
    description:
      - The registration key pool that you want to place the license in.
      - You must be mindful to name your registration pools unique names. While
        BIG-IQ does not require this, this module does. If you do not do this,
        the behavior of the module is undefined and you may end up putting
        licenses in the wrong registration key pool.
    type: str
    required: True
  license_key:
    description:
      - The license key to put in the pool.
    type: str
    required: True
  description:
    description:
      - Description of the license.
    type: str
  accept_eula:
    description:
      - A key that signifies that you accept the F5 EULA for this license.
      - A copy of the EULA can be found here https://askf5.f5.com/csp/article/K12902
      - This is required when C(state) is C(present).
    type: bool
  state:
    description:
      - The state of the regkey license in the pool on the system.
      - When C(present), guarantees that the license exists in the pool.
      - When C(absent), removes the license from the pool.
    type: str
    choices:
      - absent
      - present
    default: present
requirements:
  - BIG-IQ >= 5.3.0
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s.
- name: Add a registration key license to a pool
  bigiq_regkey_license:
    regkey_pool: foo-pool
    license_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
    accept_eula: yes
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove a registration key license from a pool
  bigiq_regkey_license:
    regkey_pool: foo-pool
    license_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
description:
  description: The new description of the license key.
  returned: changed
  type: str
  sample: My license for BIG-IP 1
N(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spect
ParameterscB`s<eZidd6ZddgZdgZdgZd�ZRS(tlicense_keytregKeytdescriptioncC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(treturnablestgetattrt_filter_paramst	Exception(tselftresultt
returnable((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyt	to_return�s
(t__name__t
__module__tapi_maptapi_attributesRt
updatablesR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR
ps
		t
ApiParameterscB`seZRS((RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR�stModuleParameterscB`s eZed��Zd�ZRS(c`su�jdr�jdS�j�}t�fd�|D�d�}|dkr^td��n|j�jd<|jS(Ntregkey_pool_uuidc3`s'|]}|j�jkr|VqdS(N(tnametregkey_pool(t.0tx(R(sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pys	<genexpr>�ss)Could not find the specified regkey pool.(t_valuestread_current_from_devicetnexttNoneR
tid(Rt
collectiontresource((RsS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR �s
cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��nd|kr�gSg|dD]}t
d|�^q�}|S(	Ns=https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licensestservertserver_porttcodei�tmessagetitemstparams(tformattclienttprovidertapitgettjsont
ValueErrorR
tstrtcontentR(RturitresptresponsetextrR((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR&�s 
&(RRtpropertyR R&(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(RRRR(RRR((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR�s
(RRR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRA�st
UsableChangescB`seZRS((RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRB�stReportableChangescB`seZRS((RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRC�st
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(RRERF((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RtAttributeErrort_Difference__default(RtparamR((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RRERFRH(RRJtattr1tattr2((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyt	__default�s
N(RRR(RGRKRI(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRD�s	t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(cO`sg|jdd�|_t|jj�|_td|jd|jj�|_t�|_	t
�|_dS(NtmoduleR3R1(R6R(RPR	R1R3RRERRFRBtchanges(Rtargstkwargs((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRG�s
!cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR1(R
RRRER(RBRQ(Rtchangedtkey((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyt_set_changed_options�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(NR1(RDRERFR
RtdictRKR(t
isinstancetupdateRBRQtTruetFalse(RtdiffRRTtktchange((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(R_RZR[(RR((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentR1RT(R[RWREtstateRaRbRCRQRRYt_announce_deprecations(RRTRRct
reportableRQ((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pytexec_modules	

cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRPt	deprecate(RRtwarningstwarning((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRds


cC`s$|j�r|j�S|j�SdS(N(texistsRYtcreate(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRas
cC`s�dj|jjd|jjd|jj|jj�}|jjj|�}y|j�}Wnt	k
rqt
SX|jdks�d|kr�|ddkr�t
StS(NsOhttps://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}R,R-i�R.(
R2R3R4RER RR5R6R7R8R[RRZ(RR;R<R=((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRn#s

	
+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(R&RFR`R[RPt
check_modeRZtupdate_on_device(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRY3s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RPRpRZtremove_from_deviceRnR
(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pytremove<s
cC`sI|j�|jjrtS|jjtkr;td��n|j�tS(NscTo add a license, you must accept its EULA. Please see the module documentation for a link to this.(	RVRPRpRZREtaccept_eulaR[R
tcreate_on_device(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRoDs

cC`sh|jj�}|jj|d<d|d<dj|jjd|jjd|jj�}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��nxitd�D][}|j�}|jd
kr*Pn)|jdkr,tddd|j�}dj|jjd|jjd|jj|jj�}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd|krS|dd	krSd|krt|d��q)t|j
��qSn'|jdkrStt|j���ntjd�qWdS(NR!tACTIVATING_AUTOMATICRsKhttps://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offeringsR,R-R7R.i�i�R/i<tREADYt%ACTIVATING_AUTOMATIC_NEED_EULA_ACCEPTt"ACTIVATING_AUTOMATIC_EULA_ACCEPTEDteulaTextsOhttps://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}tACTIVATION_FAILEDi(i�i�(REt
api_paramsR!R2R3R4R R5tpostR7R8R
R9R:trangeR&RRWRzRtpatchR/ttimetsleep(RR1R;R<R=R>R$R+((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRuOsR




	cC`s�|jj�}dj|jjd|jjd|jj|jj�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d|kr�t|d��q�t|j��ndS(NsOhttps://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}R,R-R7R.i�R/(RQR|R2R3R4RER RR5RR7R8R
R9R:(RR1R;R<R=R>((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRq�s

	cC`s|j�r|j�StS(N(RnRsR[(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRb�s
cC`sddj|jjd|jjd|jj|jj�}|jjj|�}|jdkr`t	SdS(NsOhttps://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}R,R-i�(
R2R3R4RER RR5tdeleteRRZ(RR;R<((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRr�s

	cC`s�dj|jjd|jjd|jj|jj�}|jjj|�}y|j�}Wn%t	k
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��nt
d|�S(NsOhttps://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}R,R-R.i�R/R1(R2R3R4RER RR5R6R7R8R
R9R:R(RR;R<R=R>((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR&�s

	(RRRGRVR_R`RfRdRaRnRYRsRoRuRqRbRrR&(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRO�s 													3			tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dtdtdt�dt�dtdd�d	td
dddd
g��}i|_|jjt�|jj|�d	ddggg|_dS(NR"trequiredRtno_logRRtttypetboolRctdefaultRatchoicesRb(RZtsupports_check_modeRWt
argument_specRYRtrequired_if(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyRG�s			(RRRG(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyR��scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�RPRh(R�RR�R�R�RORft	exit_jsonR
t	fail_jsonR9(tspecRPtmmtresultsR>((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pytmain�s			t__main__("t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR�tansible.module_utils.basicRt%library.module_utils.network.f5.bigiqR	t&library.module_utils.network.f5.commonR
RRtImportErrort%ansible.module_utils.network.f5.bigiqt&ansible.module_utils.network.f5.commonR
RRRARBRCtobjectRDROR�R�R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_regkey_license.pyt<module>s>


1
"�	

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