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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
lm
Z
ddlmZy�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZ defd��YZ!defd��YZ"de#fd ��YZ$d!e#fd"��YZ%d#e#fd$��YZ&d%e%fd&��YZ'd'e%fd(��YZ(d)e#fd*��YZ)d+�Z*e+d,kr�e*�ndS(-i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bysL
---
module: bigip_asm_policy_manage
short_description: Manage BIG-IP ASM policies
description:
   - Manage BIG-IP ASM policies, create from templates and manage global policy settings.
version_added: 2.8
options:
  active:
    description:
      - If C(yes) will apply and activate existing inactive policy. If C(no), it will
        deactivate existing active policy. Generally should be C(yes) only in cases where
        you want to activate new or existing policy.
    default: no
    type: bool
  name:
    description:
      - The ASM policy to manage or create.
    type: str
    required: True
  state:
    description:
      - When C(state) is C(present), and C(template) parameter is provided,
        new ASM policy is created from template with the given policy C(name).
      - When C(state) is present and no C(template) parameter is provided
        new blank ASM policy is created with the given policy C(name).
      - When C(state) is C(absent), ensures that the policy is removed, even if it is
        currently active.
    type: str
    choices:
      - present
      - absent
    default: present
  template:
    description:
      - An ASM policy built-in template. If the template does not exist we will raise an error.
      - Once the policy has been created, this value cannot change.
      - The C(Comprehensive), C(Drupal), C(Fundamental), C(Joomla),
        C(Vulnerability Assessment Baseline), and C(Wordpress) templates are only available
        on BIG-IP versions >= 13.
    type: str
    choices:
      - ActiveSync v1.0 v2.0 (http)
      - ActiveSync v1.0 v2.0 (https)
      - Comprehensive
      - Drupal
      - Fundamental
      - Joomla
      - LotusDomino 6.5 (http)
      - LotusDomino 6.5 (https)
      - OWA Exchange 2003 (http)
      - OWA Exchange 2003 (https)
      - OWA Exchange 2003 with ActiveSync (http)
      - OWA Exchange 2003 with ActiveSync (https)
      - OWA Exchange 2007 (http)
      - OWA Exchange 2007 (https)
      - OWA Exchange 2007 with ActiveSync (http)
      - OWA Exchange 2007 with ActiveSync (https)
      - OWA Exchange 2010 (http)
      - OWA Exchange 2010 (https)
      - Oracle 10g Portal (http)
      - Oracle 10g Portal (https)
      - Oracle Applications 11i (http)
      - Oracle Applications 11i (https)
      - PeopleSoft Portal 9 (http)
      - PeopleSoft Portal 9 (https)
      - Rapid Deployment Policy
      - SAP NetWeaver 7 (http)
      - SAP NetWeaver 7 (https)
      - SharePoint 2003 (http)
      - SharePoint 2003 (https)
      - SharePoint 2007 (http)
      - SharePoint 2007 (https)
      - SharePoint 2010 (http)
      - SharePoint 2010 (https)
      - Vulnerability Assessment Baseline
      - Wordpress
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
extends_documentation_fragment: f5
author:
  - Wojciech Wypior (@wojtek0806)
sq
- name: Create ASM policy from template
  bigip_asm_policy:
    name: new_sharepoint_policy
    template: SharePoint 2007 (http)
    state: present
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Create blank ASM policy
  bigip_asm_policy:
    name: new_blank_policy
    state: present
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Create blank ASM policy and activate
  bigip_asm_policy:
    name: new_blank_policy
    active: yes
    state: present
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Activate ASM policy
  bigip_asm_policy:
    name: inactive_policy
    active: yes
    state: present
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Deactivate ASM policy
  bigip_asm_policy_manage:
    name: active_policy
    state: present
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
s�
active:
  description: Set when activating/deactivating ASM policy
  returned: changed
  type: bool
  sample: yes
state:
  description: Action performed on the target device.
  returned: changed
  type: str
  sample: absent
template:
  description: Name of the built-in ASM policy template
  returned: changed
  type: str
  sample: OWA Exchange 2007 (https)
name:
  description: Name of the ASM policy to be managed/created
  returned: changed
  type: str
  sample: Asm_APP1_Transparent
N(t
AnsibleModule(tenv_fallback(tLooseVersion(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(ttransform_name(tf5_argument_spec(ttmos_version(tmodule_provisionedt
ParameterscB`sJeZdgZdddgZddgZiZed��Zd�ZRS(tactivetnamettemplatecC`s>|jddk	r|jdSd}dj|jjd|jjd�}dj|jj��}|jjj||�}y|j	�}Wn%t
k
r�}tt|���nXd|kr|ddkrd|kr�t|d��qt|j
��nd	|kr:|d	gkr:td
|d	dd�}n|S(
Nt
template_links-https://{0}:{1}/mgmt/tm/asm/policy-templates/tservertserver_ports?$filter=contains(name,'{0}')tcodei�tmessagetitemstlinkitselfLink(t_valuestNonetformattclienttproviderRtuppertapitgettjsont
ValueErrorRtstrtcontenttdict(tselftresultturitquerytresptresponsetex((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s&
cC`s@i}x$|jD]}t||�||<qW|j|�}|S(N(treturnablestgetattrt_filter_params(R,R-t
returnable((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyt	to_return�s
(	t__name__t
__module__t
updatablesR3tapi_attributestapi_maptpropertyRR7(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s			tV1ParameterscB`seZed��ZRS(cC`s|jddkrdSidd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6}|jd|kr
||jdStd<��dS(=NRt)POLICY_TEMPLATE_ACTIVESYNC_V1_0_V2_0_HTTPsActiveSync v1.0 v2.0 (http)t*POLICY_TEMPLATE_ACTIVESYNC_V1_0_V2_0_HTTPSsActiveSync v1.0 v2.0 (https)t$POLICY_TEMPLATE_LOTUSDOMINO_6_5_HTTPsLotusDomino 6.5 (http)t%POLICY_TEMPLATE_LOTUSDOMINO_6_5_HTTPSsLotusDomino 6.5 (https)t&POLICY_TEMPLATE_OWA_EXCHANGE_2003_HTTPsOWA Exchange 2003 (http)t'POLICY_TEMPLATE_OWA_EXCHANGE_2003_HTTPSsOWA Exchange 2003 (https)t6POLICY_TEMPLATE_OWA_EXCHANGE_2003_WITH_ACTIVESYNC_HTTPs(OWA Exchange 2003 with ActiveSync (http)t7POLICY_TEMPLATE_OWA_EXCHANGE_2003_WITH_ACTIVESYNC_HTTPSs)OWA Exchange 2003 with ActiveSync (https)t&POLICY_TEMPLATE_OWA_EXCHANGE_2007_HTTPsOWA Exchange 2007 (http)t'POLICY_TEMPLATE_OWA_EXCHANGE_2007_HTTPSsOWA Exchange 2007 (https)t6POLICY_TEMPLATE_OWA_EXCHANGE_2007_WITH_ACTIVESYNC_HTTPs(OWA Exchange 2007 with ActiveSync (http)t7POLICY_TEMPLATE_OWA_EXCHANGE_2007_WITH_ACTIVESYNC_HTTPSs)OWA Exchange 2007 with ActiveSync (https)t&POLICY_TEMPLATE_OWA_EXCHANGE_2010_HTTPsOWA Exchange 2010 (http)t'POLICY_TEMPLATE_OWA_EXCHANGE_2010_HTTPSsOWA Exchange 2010 (https)t&POLICY_TEMPLATE_ORACLE_10G_PORTAL_HTTPsOracle 10g Portal (http)t'POLICY_TEMPLATE_ORACLE_10G_PORTAL_HTTPSsOracle 10g Portal (https)t,POLICY_TEMPLATE_ORACLE_APPLICATIONS_11I_HTTPsOracle Applications 11i (http)t-POLICY_TEMPLATE_ORACLE_APPLICATIONS_11I_HTTPSsOracle Applications 11i (https)t(POLICY_TEMPLATE_PEOPLESOFT_PORTAL_9_HTTPsPeopleSoft Portal 9 (http)t)POLICY_TEMPLATE_PEOPLESOFT_PORTAL_9_HTTPSsPeopleSoft Portal 9 (https)t POLICY_TEMPLATE_RAPID_DEPLOYMENTsRapid Deployment Policyt$POLICY_TEMPLATE_SAP_NETWEAVER_7_HTTPsSAP NetWeaver 7 (http)t%POLICY_TEMPLATE_SAP_NETWEAVER_7_HTTPSsSAP NetWeaver 7 (https)t$POLICY_TEMPLATE_SHAREPOINT_2003_HTTPsSharePoint 2003 (http)t%POLICY_TEMPLATE_SHAREPOINT_2003_HTTPSsSharePoint 2003 (https)t$POLICY_TEMPLATE_SHAREPOINT_2007_HTTPsSharePoint 2007 (http)t%POLICY_TEMPLATE_SHAREPOINT_2007_HTTPSsSharePoint 2007 (https)t$POLICY_TEMPLATE_SHAREPOINT_2010_HTTPsSharePoint 2010 (http)t%POLICY_TEMPLATE_SHAREPOINT_2010_HTTPSsSharePoint 2010 (https)s?The specified template is not valid for this version of BIG-IP.(RR R(R,ttemplate_map((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRsH
(R8R9R=R(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR>stV2ParameterscB`seZed��ZRS(cC`s!|jddkrdSi#dd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6}||jdS(HNRR?sActiveSync v1.0 v2.0 (http)R@sActiveSync v1.0 v2.0 (https)tPOLICY_TEMPLATE_COMPREHENSIVEt
ComprehensivetPOLICY_TEMPLATE_DRUPALtDrupaltPOLICY_TEMPLATE_FUNDAMENTALtFundamentaltPOLICY_TEMPLATE_JOOMLAtJoomlaRAsLotusDomino 6.5 (http)RBsLotusDomino 6.5 (https)RCsOWA Exchange 2003 (http)RDsOWA Exchange 2003 (https)REs(OWA Exchange 2003 with ActiveSync (http)RFs)OWA Exchange 2003 with ActiveSync (https)RGsOWA Exchange 2007 (http)RHsOWA Exchange 2007 (https)RIs(OWA Exchange 2007 with ActiveSync (http)RJs)OWA Exchange 2007 with ActiveSync (https)RKsOWA Exchange 2010 (http)RLsOWA Exchange 2010 (https)RMsOracle 10g Portal (http)RNsOracle 10g Portal (https)ROsOracle Applications 11i (http)RPsOracle Applications 11i (https)RQsPeopleSoft Portal 9 (http)RRsPeopleSoft Portal 9 (https)RSsRapid Deployment PolicyRTsSAP NetWeaver 7 (http)RUsSAP NetWeaver 7 (https)RVsSharePoint 2003 (http)RWsSharePoint 2003 (https)RXsSharePoint 2007 (http)RYsSharePoint 2007 (https)RZsSharePoint 2010 (http)R[sSharePoint 2010 (https)t(POLICY_TEMPLATE_VULNERABILITY_ASSESSMENTs!Vulnerability Assessment BaselinetPOLICY_TEMPLATE_WORDPRESSt	Wordpress(RR (R,R\((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR2sN
(R8R9R=R(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR]1stChangescB`seZed��ZRS(cC`s!|jddkrdSi#dd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6}||jdS(HNRsActiveSync v1.0 v2.0 (http)R?sActiveSync v1.0 v2.0 (https)R@R_R^RaR`RcRbReRdsLotusDomino 6.5 (http)RAsLotusDomino 6.5 (https)RBsOWA Exchange 2003 (http)RCsOWA Exchange 2003 (https)RDs(OWA Exchange 2003 with ActiveSync (http)REs)OWA Exchange 2003 with ActiveSync (https)RFsOWA Exchange 2007 (http)RGsOWA Exchange 2007 (https)RHs(OWA Exchange 2007 with ActiveSync (http)RIs)OWA Exchange 2007 with ActiveSync (https)RJsOWA Exchange 2010 (http)RKsOWA Exchange 2010 (https)RLsOracle 10g Portal (http)RMsOracle 10g Portal (https)RNsOracle Applications 11i (http)ROsOracle Applications 11i (https)RPsPeopleSoft Portal 9 (http)RQsPeopleSoft Portal 9 (https)RRsRapid Deployment PolicyRSsSAP NetWeaver 7 (http)RTsSAP NetWeaver 7 (https)RUsSharePoint 2003 (http)RVsSharePoint 2003 (https)RWsSharePoint 2007 (http)RXsSharePoint 2007 (https)RYsSharePoint 2010 (http)RZsSharePoint 2010 (https)R[s!Vulnerability Assessment BaselineRfRhRg(RR (R,R\((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR_sN
(R8R9R=R(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRi^st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R,RkRl((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R4tAttributeErrort_Difference__default(R,tparamR-((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R4RkRlRn(R,Rptattr1tattr2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyt	__default�s
cC`sT|jjtkr(|jjtkr(tS|jjtkrP|jjtkrPtSdS(N(RkRtTrueRltFalse(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s$$N(R8R9R RmRqRoR=R(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRj�s			tBaseManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cO`sC|jdd�|_|jdd�|_d|_t�|_dS(NR"tmodule(R&R R"RxRlRitchanges(R,targstkwargs((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRm�s	cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}n|jj�}|j|�|jtd|��|S(Ntpresenttabsenttchanged(	RvR+RktstateR|R}RyR7tupdate(R,R~R-RRy((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pytexec_module�s	
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(Ntparams(RR3R4RkR RiRy(R,R~tkey((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyt_set_changed_options�scC`s|j�}|rtStS(N(t_update_changed_optionsRuRv(R,R-((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyt
should_update�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(NR�(RjRkRlRR:R+RqR t
isinstanceR�RiRyRuRv(R,tdiffR:R~tktchange((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s		
cC`s$|j�r|j�S|j�SdS(N(texistsR�tcreate(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR|�s
cC`s|j�stS|j�SdS(N(R�Rvtremove(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR}�scC`s�|jjdkr.|jjtdt��n|j�|jjrHt	S|jj
dk	rg|j�n|jj
dkr�|j�n|jjr�|j
�t	St	SdS(NR(RkRR R�R+RvR�Rxt
check_modeRuRtcreate_from_templatetcreate_blanktactivate(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s



cC`sV|j�|_|j�stS|jjr/tS|j�|jj	rR|j
�ntS(N(tread_current_from_deviceRlR�RvRxR�Rutupdate_on_deviceRyRR�(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s

cC`s>|j�|_|j�}|j|�r.tStd��dS(NsApply policy task failed.(R�Rltapply_on_devicet
wait_for_taskRuR(R,ttask_id((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s
cC`s9|j�|j�rtStdj|jj���dS(Ns Failed to create ASM policy: {0}(tcreate_on_deviceR�RuRR!RkR(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s

cC`sH|jjrtS|j�|j�rDtdj|jj���ntS(Ns Failed to delete ASM policy: {0}(	RxR�Rutremove_from_deviceR�RR!RkR(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s
cC`s|jjtkrtStSdS(N(RkRRuRv(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pytis_activated!scC`s�dj|jjd|jjd�}dj|jj|jj�}|jjj||�}y|j�}Wn%t	k
r�}t
t|���nXd|kr�|dgkr�tSt
S(Ns%https://{0}:{1}/mgmt/tm/asm/policies/RRsR?$filter=contains(name,'{0}')+and+contains(partition,'{1}')&$select=name,partitionR(R!R"R#RkRt	partitionR%R&R'R(RR)RuRv(R,R.R/R0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�'s
cC`sdj|jjd|jjd|�}x�tr�|jjj|�}y|j�}Wn%tk
r~}tt	|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��n|ddkr�Pntjd
�q,W|dd	krt
S|ddkrtSdS(Ns2https://{0}:{1}/mgmt/tm/asm/tasks/apply-policy/{2}RRRi�RRt	COMPLETEDtFAILUREi(R�sFAILURE(R!R"R#RuR%R&R'R(RR)R*ttimetsleepRv(R,R�R.R0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�:s*

		cC`s�d}dj|jjd|jjd�}dj|jj|jj�}|jjj||�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|dgkr�|ddd}n|s�td��n|S(	Ns%https://{0}:{1}/mgmt/tm/asm/policies/RRsK?$filter=contains(name,'{0}')+and+contains(partition,'{1}')&$select=name,idRitidsThe policy was not found(
R R!R"R#RkRR�R%R&R'R(RR)(R,t	policy_idR.R/R0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyt_get_policy_idWs 
cC`s�|jj�}|j�}dj|jjd|jjd|�}|ds�|jjj|d|�}y|j�}Wn%t	k
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��q�ndS(	Ns(https://{0}:{1}/mgmt/tm/asm/policies/{2}RRRR'Ri�R(
Ryt
api_paramsR�R!R"R#R%tpatchR'R(RR)R*(R,R�R�R.R0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�ns 

	
cC`s�|j�}dj|jjd|jjd|�}|jjj|�}y|j�}Wn%tk
r�}tt	|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��n|jtd|d��t
d	|�S(
Ns(https://{0}:{1}/mgmt/tm/asm/policies/{2}RRRi�Rt	self_linkRR�(R�R!R"R#R%R&R'R(RR)R*R�R+R(R,R�R.R0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s 

	cC`s�dj|jjd|jjd�}tdi|jjd6�}|jjj|d|�}y|j�}Wn%t	k
r�}t
t|���nXd|kr�|ddkr�d
|kr�t
|d
��q�t
|j��n|dS(
Ns/https://{0}:{1}/mgmt/tm/asm/tasks/apply-policy/RRtpolicyReferenceRR'Ri�i�RR�(i�i�(
R!R"R#R+RlR�R%tpostR'R(RR)R*(R,R.R�R0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s
cC`sMt|jj|jj�}dj||jj�}dj|jjd|jjd�}tddddj|��}|jj	j
|d	|�}yB|j�}d
|kr�d|d
kr�t|d
��q�nWn%t
k
r�}tt|���nXd|krI|dd
krId|kr7t|d��qIt|j��ndS(Ns.tmsh create asm policy {0} policy-template {1}s"https://{0}:{1}/mgmt/tm/util/bash/RRtcommandtruntutilCmdArgss-c "{0}"R't
commandResultsUnexpected ErrorRi�R(RRkR�RR!RR"R#R+R%R�R'RR(R)R*(R,t	full_nametcmdR.RzR0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pytcreate_from_template_on_device�s(
cC`s|jj�}|jj|d<|jj|d<|jd�dj|jjd|jjd�}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr|ddkrd|kr�t
|d��qt
|j��ntjd
�tS(NRR�Rs%https://{0}:{1}/mgmt/tm/asm/policies/RRR'Ri�i�i�Ri(i�i�i�(RyR�RkRR�tpopR!R"R#R%R�R'R(RR)R*R�R�Ru(R,R�R.R0R1R2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s$


cC`sp|j�}dj|jjd|jjd|�}|jjj|�}|jdkr]tSt|j	��dS(Ns(https://{0}:{1}/mgmt/tm/asm/policies/{2}RRi�i�(i�i�(
R�R!R"R#R%tdeleteRRuRR*(R,R�R.R1((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s

	(R8R9RmR�R�R�R�R|R}R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRw�s,													
									t
ModuleManagercB`s,eZd�Zd�Zd�Zd�ZRS(cO`s7|jdd�|_t|jj�|_||_dS(NRx(R&R RxRR�R"R{(R,RzR{((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRm�scC`sXt|jd�s!td��n|j�r?|jd�}n|jd�}|j�S(Ntasms+ASM must be provisioned to use this module.tv1tv2(RR"Rtversion_is_less_than_13tget_managerR�(R,tmanager((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��scC`s6|dkrt|j�S|dkr2t|j�SdS(NR�R�(t	V1ManagerR{t	V2Manager(R,ttype((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s
cC`s3t|j�}t|�td�kr+tStSdS(Ns13.0.0(RR"R
RuRv(R,tversion((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�	s(R8R9RmR�R�R�(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR��s			R�cB`seZd�Zd�ZRS(cO`s_|jdd�}t|j�}tt|�jd|d|�td|jd|�|_dS(NRxR"R�(	R&R RR�tsuperR�RmR>Rk(R,RzR{RxR"((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRmscC`s|j�dS(N(R�(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s(R8R9RmR�(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s	R�cB`seZd�Zd�ZRS(cO`s_|jdd�}t|j�}tt|�jd|d|�td|jd|�|_dS(NRxR"R�(	R&R RR�R�R�RmR]Rk(R,RzR{RxR"((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRmscC`s|j�stSdS(N(R�Rv(R,((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�%s(R8R9RmR�(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�s	tArgumentSpeccB`seZd�ZRS(c#C`s ddddddddd	d
ddd
ddddddddddddddddddd d!d"d#g#|_t|_td$td%t�d&td'|j�d(td)d*d+d,�d-td+d.d'd.d/g�d0td+d1d2td3gf��}i|_|jjt�|jj|�dS(4NsActiveSync v1.0 v2.0 (http)sActiveSync v1.0 v2.0 (https)R_RaRcResLotusDomino 6.5 (http)sLotusDomino 6.5 (https)sOWA Exchange 2003 (http)sOWA Exchange 2003 (https)s(OWA Exchange 2003 with ActiveSync (http)s)OWA Exchange 2003 with ActiveSync (https)sOWA Exchange 2007 (http)sOWA Exchange 2007 (https)s(OWA Exchange 2007 with ActiveSync (http)s)OWA Exchange 2007 with ActiveSync (https)sOWA Exchange 2010 (http)sOWA Exchange 2010 (https)sOracle 10g Portal (http)sOracle 10g Portal (https)sOracle Applications 11i (http)sOracle Applications 11i (https)sPeopleSoft Portal 9 (http)sPeopleSoft Portal 9 (https)sRapid Deployment PolicysSAP NetWeaver 7 (http)sSAP NetWeaver 7 (https)sSharePoint 2003 (http)sSharePoint 2003 (https)sSharePoint 2007 (http)sSharePoint 2007 (https)sSharePoint 2010 (http)sSharePoint 2010 (https)s!Vulnerability Assessment BaselineRhRtrequiredRtchoicesRR�tbooltdefaulttnoRR|R}R�tCommontfallbacktF5_PARTITION(R\Rutsupports_check_modeR+R	t
argument_specR�R(R,R�((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyRm+sj				(R8R9Rm(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyR�*scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�Rxtmsg(
R�RR�R�R�R�t	exit_jsonRt	fail_jsonR)(tspecRxtmmtresultsR2((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pytmainks		t__main__(,t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR�tansible.module_utils.basicRR	tdistutils.versionR
t%library.module_utils.network.f5.bigipRt&library.module_utils.network.f5.commonRR
RRRt(library.module_utils.network.f5.icontrolRRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont(ansible.module_utils.network.f5.icontrolRR>R]RitobjectRjRwR�R�R�R�R�R8(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_asm_policy_manage.pyt<module>sV


W7
8,--�KA	

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