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

�
�Udac@`sSddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZyTddlmZddlmZddlmZddlmZddlmZWnaek
r9ddlmZddlmZddlmZddlmZddlmZnXyddlZWnek
riddlZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ d e!fd!��YZ"d"e!fd#��YZ#d$e!fd%��YZ$d&�Z%e&d'krOe%�ndS((i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_appsvcs_extension
short_description: Manage application service deployments
description:
  - Manages application service deployments via the App Services Extension functionality
    in BIG-IP.
version_added: 2.7
options:
  content:
    description:
      - Declaration of tenants configured on the system.
      - This parameter is most often used along with the C(file) or C(template) lookup plugins.
        Refer to the examples section for correct usage.
      - For anything advanced or with formatting consider using the C(template) lookup.
      - This can additionally be used for specifying application service configurations
        directly in YAML, however that is not an encouraged practice and, if used at all,
        should only be used for the absolute smallest of configurations to prevent your
        Playbooks from becoming too large.
      - If you C(content) includes encrypted values (such as ciphertexts, passphrases, etc),
        the returned C(changed) value will always be true.
      - If you are using the C(to_nice_json) filter, it will cause this module to fail because
        the purpose of that filter is to format the JSON to be human-readable and this process
        includes inserting "extra characters that break JSON validators.
    type: raw
    required: True
  tenants:
    description:
      - A list of tenants that you want to remove.
      - This parameter is only relevant when C(state) is C(absent). It will be ignored when
        C(state) is C(present).
      - A value of C(all) will remove all tenants.
      - Tenants can be specified as a list as well to remove only specific tenants.
    type: raw
  force:
    description:
      - Force updates a declaration.
      - This parameter should be used in cases where your declaration includes items that
        are encrypted or in cases (such as WAF Policies) where you want a large reload to take place.
    type: bool
    default: no
  state:
    description:
      - When C(state) is C(present), ensures the configuration exists.
      - When C(state) is C(absent), ensures that the configuration is removed.
    type: str
    choices:
      - present
      - absent
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s�
- name: Deploy an app service configuration
  bigip_appsvcs_extension:
    content: "{{ lookup('file', '/path/to/appsvcs.json') }}"
    state: present
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove all app service configurations
  bigip_appsvcs_extension:
    tenants: all
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove tenants T1 and T2 from app service configurations
  bigip_appsvcs_extension:
    tenants:
      - T1
      - T2
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
se
action:
  description:
    - The action performed.
  returned: changed
  type: str
  sample: deploy
(t
AnsibleModule(t	iteritems(tstring_types(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_specNt
ParameterscB`s4eZidd6dd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6dd6Zdddd dddd	dd
dddd!dddddgZdddd ddddd
ddddd!dddddgZdddd ddddd
ddddd!dddddgZRS("t
class_nametclasst
patch_bodyt	patchBodytresource_timeouttresourceTimeoutttarget_timeoutt
targetTimeoutt
target_tokensttargetTokensttarget_passphrasettargetPassphrasettarget_usernamettargetUsernamettarget_portt
targetPortttarget_hostt
targetHosttretrieve_agetretrieveAget	log_leveltlogLevelt
history_limitthistoryLimitt
sync_to_grouptsyncToGrouptredeploy_update_modetredeployUpdateModetredeploy_agetredeployAgetactiontpersisttdeclarationttrace(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR�s�
		t
ApiParameterscB`seZRS((R3R4(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR9�stModuleParameterscB`sqeZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	RS(cC`sV|jddkrdSt|jdt�rGtj|jdpCd�S|jdSdS(Ntcontenttnull(t_valuestNonet
isinstanceR
tjsontloads(tself((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR;�s
cC`s|jdjdd�S(NR;R(R=tgetR>(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR�scC`s|jdjdd�S(NR;R/(R=RCR>(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR/�scC`s|jdjdd�S(NR;R1(R=RCR>(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR1�scC`s8|jdr$|jdjdd�S|jr4|jSdS(NR;R0(R=RCR>t
param_persist(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR0�s

	cC`s4|jddkrdS|jdjdd�}|S(Nt
parametersR0(R=R>RC(RBtresult((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRDscC`sE|jddkrdSt|jdt�rAdj|jd�SdS(Nttenantstalltt,(Nsall(R=R>R?tlisttjoin(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRG	s(
R3R4tpropertyR;RR/R1R0RDRG(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR:�s	tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R7tgetattrt_filter_paramst	Exception(RBRFt
returnable((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyt	to_returns
(R3R4RS(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRNst
UsableChangescB`seZRS((R3R4(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRTstReportableChangescB`sDeZed��Zed��Zed��Zed��ZRS(cC`sdS(N(R>(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR1"scC`sdS(N(R>(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR&scC`sdS(N(R>(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR*scC`sdS(N(R>(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR0.s(R3R4RMR1RRR0(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRU!st
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(RBRWRX((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyt__init__4s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(ROtAttributeErrort_Difference__default(RBtparamRF((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pytcompare8s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RORWRXRZ(RBR\tattr1tattr2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyt	__default?s
N(R3R4R>RYR]R[(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRV3s	t
ModuleManagercB`s}eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(RCR>RbRRctclientR:RWR9RXRTtchanges(RBtargstkwargs((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRYJs
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRc(RR7RORWR>RTRe(RBtchangedtkey((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyt_set_changed_optionsQscC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|S(NtpresenttabsentRcRh(
tFalsetdictRWtstateRkRlRUReRStupdate(RBRhRFRot
reportableRe((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pytexec_moduleYs	
cC`s|j�rtS|j�S(N(texistsRmtupsert(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRkiscC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(Rbt
check_modetTruetremove_from_devicet
tenant_existsR(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pytremovens
cC`sI|j�|jjrtS|jjdkr;td��n|j�tS(NRHs7'all' keyword cannot be used when 'state' is 'present'.(RjRbRuRvRWR;Rtupsert_on_device(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRtvs

cC`s�g}d|krRd|kr2|j|d�nd|kr�||d7}q�nbx_|dD]S}d|kr�|ddkr�|j|d�nd|kr]||d7}q]q]W|S(Ntresultstmessageterrorssdeclaration failedtresponse(tappend(RBtmessagesR{R|((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyt_get_errors_from_response�scC`s�dj|jjd|jjd�}|jjj|d|jj�}|jdkr�|j�}|j	|�}|r�djdj
|��}t|��nt|j��nH|j�}|j	|�}|r�djdj
|��}t|��ndS(Ns,https://{0}:{1}/mgmt/shared/appsvcs/declare/tservertserver_portR@i�s{0}s. (tformatRdtprovidertapitpostRWR;RR@R�RLR(RBturitrespRFR}R|((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRz�s 
!c`s}t|t�rud|kr,t|dd<nd|krU|ddkrUt|d<nt�fd�t|�D��S|SdS(Nt
passphraset
ignoreChangesRt
WAF_Policyc3`s*|] \}}|�j|�fVqdS(N(tignore_changes(t.0tktv(RB(sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pys	<genexpr>�s(R?RnRvR	(RBtobj((RBsV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR��s
 cC`s#i}|jjdkr'td��ny|j|jj�Wntk
r]td��nXd|d<|jjs�|j|�ndj|j	j
d|j	j
d�}|j	jj|d|�}y|j
�}Wntk
r�tSXy |d	d
ddkr	tSWntk
rtSXdS(
Ns<Empty content cannot be specified when 'state' is 'present'.s|The provided 'content' could not be converted into valid json. If you are using the 'to_nice_json' filter, please remove it.sdry-runR/s,https://{0}:{1}/mgmt/shared/appsvcs/declare/R�R�R@R{iR|s	no change(RWR;R>RRpt
ValueErrortforceR�R�RdR�R�R�R@RmRvtKeyError(RBR1R�R�R~((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRs�s2






cC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wntk
rht	SX|j
dks�d|kr�|ddkr�t	StS(Ns/https://{0}:{1}/mgmt/shared/appsvcs/declare/{2}R�R�i�t
statusCode(R�RdR�RWRGR�RCR@R�RmRRv(RBR�R�R~((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRx�s


+cC`s|j�r|j�StS(N(RxRyRm(RB((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRl�s
cC`s�dj|jjd|jjd|jj�}|jjj|�}|jdkr�|j�}|j	|�}|r�djdj
|��}t|��nt|j��ndS(Ns/https://{0}:{1}/mgmt/shared/appsvcs/declare/{2}R�R�i�s{0}s. (
R�RdR�RWRGR�tdeleteRR@R�RLRR;(RBR�R~RFR}R|((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRw�s

(R3R4RYRjRrRkRyRtR�RzR�RsRxRlRw(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRaIs									
	)		tArgumentSpeccB`seZd�ZRS(c
C`s�t|_tdtdd�dtdddddg�d	tdd�d
tdddd��}i|_|jjt�|jj|�dddggg|_dd	gg|_dS(
NR;ttypetrawRotdefaultRktchoicesRlRGR�tbooltno(Rvtsupports_check_modeRnt
argument_specRpRtrequired_iftmutually_exclusive(RBR�((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyRY�s		(R3R4RY(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyR��scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�Rbtmsg(R�RR�R�R�RaRrt	exit_jsonRt	fail_jsontstr(tspecRbtmmR{tex((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pytmains			t__main__('t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.sixR	R
t%library.module_utils.network.f5.bigipRt&library.module_utils.network.f5.commonRR
RRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonR@t
simplejsonRR9R:RNRTRUtobjectRVRaR�R�R3(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_appsvcs_extension.pyt<module>sL


7"	

V-�	

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