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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
lm
Z
ddlmZytddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��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*e#fd+��YZ)d,�Z*e+d-kr�e*�ndS(.i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�

---
module: bigip_policy
short_description: Manage general policy configuration on a BIG-IP
description:
  - Manages general policy configuration on a BIG-IP. This module is best
    used in conjunction with the C(bigip_policy_rule) module. This module
    can handle general configuration like setting the draft state of the policy,
    the description, and things unrelated to the policy rules themselves.
    It is also the first module that should be used when creating rules as
    the C(bigip_policy_rule) module requires a policy parameter.
version_added: 2.5
options:
  description:
    description:
      - The description to attach to the policy.
      - This parameter is only supported on versions of BIG-IP >= 12.1.0. On earlier
        versions it will simply be ignored.
    type: str
  name:
    description:
      - The name of the policy to create.
    type: str
    required: True
  state:
    description:
      - When C(state) is C(present), ensures that the policy exists and is
        published. When C(state) is C(absent), ensures that the policy is removed,
        even if it is currently drafted.
      - When C(state) is C(draft), ensures that the policy exists and is drafted.
        When modifying rules, it is required that policies first be in a draft.
      - Drafting is only supported on versions of BIG-IP >= 12.1.0. On versions
        prior to that, specifying a C(state) of C(draft) will raise an error.
    type: str
    choices:
      - present
      - absent
      - draft
    default: present
  strategy:
    description:
      - Specifies the method to determine which actions get executed in the
        case where there are multiple rules that match. When creating new
        policies, the default is C(first).
      - This module does not allow you to specify the C(best) strategy to use.
        It will choose the system default (C(/Common/best-match)) for you instead.
    type: str
    choices:
      - first
      - all
      - best
  rules:
    description:
      - Specifies a list of rules that you want associated with this policy.
        The order of this list is the order they will be evaluated by BIG-IP.
        If the specified rules do not exist (for example when creating a new
        policy) then they will be created.
      - The C(conditions) for a default rule are C(all).
      - The C(actions) for a default rule are C(ignore).
      - The C(bigip_policy_rule) module can be used to create and edit existing
        and new rules.
    type: list
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create policy which is immediately published
  bigip_policy:
    name: Policy-Foo
    state: present
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add a rule to the new policy - Immediately published
  bigip_policy_rule:
    policy: Policy-Foo
    name: ABC
    conditions:
      - type: http_uri
        path_starts_with:
          - /ABC
          - foo
          - bar
        path_ends_with:
          - baz
    actions:
      - forward: yes
        select: yes
        pool: pool-svrs
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add multiple rules to the new policy - Added in the order they are specified
  bigip_policy_rule:
    policy: Policy-Foo
    name: "{{ item.name }}"
    conditions: "{{ item.conditions }}"
    actions: "{{ item.actions }}"
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
  loop:
    - name: rule1
      actions:
        - type: forward
          pool: pool-svrs
      conditions:
        - type: http_uri
          path_starts_with: /euro
    - name: HomePage
      actions:
        - type: forward
          pool: pool-svrs
      conditions:
        - type: http_uri
          path_starts_with: /HomePage/

- name: Create policy specify default rules - Immediately published
  bigip_policy:
    name: Policy-Bar
    state: present
    rules:
      - rule1
      - rule2
      - rule3
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Create policy specify default rules - Left in a draft
  bigip_policy:
    name: Policy-Baz
    state: draft
    rules:
      - rule1
      - rule2
      - rule3
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
s�
strategy:
  description: The new strategy set on the policy.
  returned: changed and success
  type: int
  sample: first-match
description:
  description:
    - The new description of the policy.
    - This value is only returned for BIG-IP devices >= 12.1.0.
  returned: changed and success
  type: str
  sample: This is my description
rules:
  description: List of the rules, and their order, applied to the policy.
  returned: changed and success
  type: list
  sample: ['/Common/rule1', '/Common/rule2']
N(t
AnsibleModule(tenv_fallback(tLooseVersion(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(ttmos_versiont
ParameterscB`sAeZd�Zed��Zd�Zd�Zed��ZRS(cC`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_policy.pyt	to_return�s
cC`s�|jddkrdS|jddkr7|jd�Sd|jdkr[t|jd�S|jddkr{|jd�Sd|jdkr�t|jd�S|jddkr�|jd�Sd|jdkr�t|jd�S|j�SdS(Ntstrategytfirstsfirst-matchtalls	all-matchtbests
best-match(t_valuestNonet_get_builtin_strategytstrt_get_custom_strategy_name(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�s


cC`s
dj|�S(Ns/Common/{0}-match(tformat(RR((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR scC`sX|jd}tjd|�r#|Stjd|�rHdj|j|�Std��dS(NRs(\/[a-zA-Z_0-9.-]+){2}s[a-zA-Z_0-9.-]+s/{0}/{1}s&The provided strategy name is invalid!(RtretmatchR#t	partitionR(RR((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR"s
cC`sA|jddkrdSg|jdD]}t|�^q%}|S(Ntrules(RRR!(RtxR((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR's&(t__name__t
__module__RtpropertyRR R"R'(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�s
			tSimpleParameterscB`s)eZdgZddgZddgZRS(RR'(R)R*tapi_attributest
updatablesR(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR,s
		tComplexParameterscB`s2eZddgZdddgZdddgZRS(RtdescriptionR'(R)R*R-R.R(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR/(s		t
SimpleChangescB`s)eZdgZddgZddgZRS(RR'(R)R*R-R.R(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR1;s	tComplexChangescB`s2eZddgZdddgZdddgZRS(RR0R'(R)R*R-R.R(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR2IstBaseManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Ze	d�Z
e	d�Ze	d	�Ze	d
�Z
e	d�Ze	d�Ze	d
�ZRS(cO`sO|jdd�|_t|jj�|_d|_td|jj�|_dS(Ntmoduletparams(	tgetRR4RR5tclientthaveRtwant(Rtargstkwargs((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt__init__Xs	cC`s�g}|jr.||jjjdg�7}n|jrV||jjjdg�7}nx/|D]'}|jjd|dd|d�q]WdS(Nt__deprecatedtmsgtversion(R9RR6R8R4t	deprecate(Rtwarningstwarning((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_announce_deprecations^s		

cC`sg}|jr.||jjjdg�7}n|jrV||jjjdg�7}nx"|D]}|jj|d�q]WdS(Nt	__warningR>(R9RR6R8R4twarn(RRARB((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_announce_warningsjs		
cC`s$|j�r|j�S|j�SdS(N(texiststupdatetcreate(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pytpresentss
cC`s|j�}|rtStS(N(t_update_changed_optionstTruetFalse(RR((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt
should_updateyscC`s2|jjdkr.|jjtdd��ndS(NRR(R9RRRHtdict(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_validate_creation_parametersscC`sPd|krH|djdd��g|dD]}|d^q.}|SgSdS(NtitemstkeycS`s|dS(Ntordinal((R(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt<lambda>�stname(tsort(RR'R(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_get_rule_names�s
!cC`s9|rPdj|jjd|jjdt|jj|jjdd�|�}nGdj|jjd|jjdt|jj|jj�|jj�}|jjj|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr1|ddkr1d|krt|d��q1t|j
��n|d	S(
Ns0https://{0}:{1}/mgmt/tm/ltm/policy/{2}/rules/{3}tservertserver_porttsub_pathtDraftstcodei�tmessageRS(R#R7tproviderRR9R&RUtapiR6tjsont
ValueErrorRR!tcontent(Rt	rule_nametdraftturitresptresponsetex((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_read_rule_from_device�s*



c	C`sDtd|d|�}|rbdj|jjd|jjdt|jj|jjdd��}n>dj|jjd|jjdt|jj|jj��}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd	|kr@|d	dkr@d
|kr.t|d
��q@t|j��ndS(NRURSs-https://{0}:{1}/mgmt/tm/ltm/policy/{2}/rules/RXRYRZR[R`R\i�i�i�R](i�i�i�(ROR#R7R^RR9R&RUR_tpostR`RaRR!Rb(	RRctidxRdR5ReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_create_rule_on_device�s&

'

c	C`sPtd|�}|r_dj|jjd|jjdt|jj|jjdd�|�}nGdj|jjd|jjdt|jj|jj�|jj�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|krL|dd	d
gkrLd|kr:t|d��qLt|j��ndS(NRSs0https://{0}:{1}/mgmt/tm/ltm/policy/{2}/rules/{3}RXRYRZR[R`R\i�i�R](ROR#R7R^RR9R&RUR_tpatchR`RaRR!Rb(	RRcRkRdR5ReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_modify_rule_on_device�s*



"cC`s|rPdj|jjd|jjdt|jj|jjdd�|�}nGdj|jjd|jjdt|jj|jj�|jj�}|jjj|�}y|j	�}Wnt
k
r�tSX|jdks�d|kr|ddkrtSt
S(Ns0https://{0}:{1}/mgmt/tm/ltm/policy/{2}/rules/{3}RXRYRZR[i�R\(R#R7R^RR9R&RUR_R6R`RaRMRRL(RRcRdReRfRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_rule_exists_on_device�s&




+cC`s�|rPdj|jjd|jjdt|jj|jjdd�|�}nGdj|jjd|jjdt|jj|jj�|jj�}|jjj|�}|j	dkr�t
St|j��dS(Ns0https://{0}:{1}/mgmt/tm/ltm/policy/{2}/rules/{3}RXRYRZR[i�(
R#R7R^RR9R&RUR_tdeleteRRLRRb(RRcRdReRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_remove_rule_on_device�s



cC`s�|jj}|dkr!g}nx|t|�D]n\}}|j||�r�|j||�}t|�|kr�|j|||�q�q.|j|||�q.W|j	||�dS(N(
tchangesR'Rt	enumerateRoRitintRnRlt_remove_rule_difference(RRdR'RktruleRS((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_upsert_policy_rules_on_device
s	cC`sj|s|jjrdSt|jj�}t|�}|j|�}x|D]}|j||�qLWdS(N(R8R'tsett
differenceRq(RR'Rdt
have_rulest
want_rulest	removabletremove((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRus
(R)R*R<RCRFRJRNRPRWRMRiRlRnRoRqRwRu(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR3Ws								
t
SimpleManagercB`s}eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
cO`sJtt|�j|�td|jj�|_t�|_t�|_	dS(NR5(
tsuperR~R<R,R4R5R9R8R1Rr(RR:R;((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR<"scC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR5(R,RRR9RR1Rr(RtchangedRR((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt_set_changed_options(scC`s�t|j|j�}tj}t�}x9|D]1}|j|�}|dkrUq.q.|||<q.W|rtd|�|_	t
StS(NR5(t
DifferenceR9R8R,R.ROtcompareRR1RrRLRM(RtdiffR.R�tktchange((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRK0s		
cC`s�t}t�}|jj}|dkr6td��n|dkrQ|j�}n|dkrl|j�}n|jj�}|j	|�|j	td|��|j
�|j�|S(NRds?The 'draft' status is not available on BIG-IP versions < 12.1.0RJtabsentR�(RMROR9tstateRRJR�RrRRHRCRF(RR�RR�Rr((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pytexec_module?s 	


cC`s2|j�|j�|jjr$tS|j�tS(N(RPR�R4t
check_modeRLtcreate_on_device(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRITs


cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR8RNRMR4R�RLtupdate_on_device(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRH\s
cC`s%t}|j�r!|j�}n|S(N(RMRGR}(RR�((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�escC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the policy(R4R�RLtremove_from_deviceRGR(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR}ks
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYi�R\(R#R7R^RR9R&RUR_R6R`RaRMRRL(RReRfRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRGss


+cC`sdj|jjd|jjdt|jj|jj��}d}|jjj||�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��n|j|d�}td	|�}|jtd
|��|S(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYs?expandSubcollections=trueR\i�R]trulesReferenceR5R'(R#R7R^RR9R&RUR_R6R`RaRR!RbRWR,RHRO(RRetqueryRfRgRhR'R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s$

cC`s|jj�}|r�dj|jjd|jjdt|jj|jj��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��q�n|j�dS(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYR`R\i�R](Rrt
api_paramsR#R7R^RR9R&RUR_RmR`RaRR!RbRw(RR5ReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s 

cC`s|jj�}td|jjd|jj|�}dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��n|j�tS(NRUR&s#https://{0}:{1}/mgmt/tm/ltm/policy/RXRYR`R\i�i�R](i�i�(R9R�RORUR&R#R7R^R_RjR`RaRR!RbRwRL(RR5tpayloadReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s&		

cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYi�(
R#R7R^RR9R&RUR_RpRRLRRb(RReRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s

(R)R*R<R�RKR�RIRHR�R}RGR�R�R�R�(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR~!s													tComplexManagercB`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�ZRS(cO`sJtt|�j|�td|jj�|_t�|_t�|_	dS(NR5(
RR�R<R/R4R5R9R8R2Rr(RR:R;((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR<�scC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR5(R/RRR9RR2Rr(RR�RR((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��scC`s�t|j|j�}tj}t�}x9|D]1}|j|�}|dkrUq.q.|||<q.W|rtd|�|_	t
StS(NR5(R�R9R8R/R.ROR�RR2RrRLRM(RR�R.R�R�R�((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRK�s		
cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}n|jj�}|j|�|jtd|��|S(NRJRdR�R�(spresentsdraft(	RMROR9R�RJR�RrRRH(RR�RR�Rr((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s	
cC`s<|j�}|j�}td�||gD��r8tStS(Ncs`s|]}|tkVqdS(N(RL(t.0R(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pys	<genexpr>s(RKtdraft_status_changedtanyRLRM(RRtdrafted((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRNs
cC`sY|j�r'|jjdkr't}n.|j�rO|jjdkrOt}nt}|S(NRdRJ(tdraft_existsR9R�RMRL(RR�((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�s		cC`s0|j�s|j�r"|j�S|j�SdS(N(R�t
policy_existsRHRI(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRJs
cC`s1t}|j�s|j�r-|j�}n|S(N(RMR�R�R}(RR�((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�scC`sE|jjrtS|j�|j�s2|j�rAtd��ntS(NsFailed to delete the policy(R4R�RLR�R�R�R(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR} s
cC`sk|j�|j�|jjr$tS|j�s=|j�n|j�|jj	dkr]tS|j
�SdS(NRd(RPR�R4R�RLR�t_create_new_policy_draftR�R9R�tpublish(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRI(s



cC`s�|j�|_|j�stS|jjr/tS|j�sH|j�n|j	�ra|j
�n|jjdkrwtS|j
�SdS(NRd(R�R8RNRMR4R�RLR�t_create_existing_policy_draftRKR�R9R�R�(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyRH;s

cC`s�dj|jjd|jjdt|jj|jjdd��}|jjj|�}y|j	�}Wnt
k
r}tSX|jdks�d|kr�|ddkr�tSt
S(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYRZR[i�R\(R#R7R^RR9R&RUR_R6R`RaRMRRL(RReRfRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�Ms

$
+cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYi�R\(R#R7R^RR9R&RUR_R6R`RaRMRRL(RReRfRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�\s


+cC`s�tdt�}dj|jjd|jjdt|jj|jj��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��ntS(	NtcreateDrafts&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYR`R\i�R](RORLR#R7R^RR9R&RUR_RmR`RaRR!Rb(RR5ReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�ks

cC`s|jj�}td|jjd|jjdd|�}dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd	|kr�|d	d
kr�d|kr�t|d��q�t|j��ntS(NRUR&tsubPathR[s#https://{0}:{1}/mgmt/tm/ltm/policy/RXRYR`R\i�i�R](i�i�(R9R�RORUR&R#R7R^R_RjR`RaRR!RbRL(RR5R�ReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�s&	
cC`s|jj�}|r�dj|jjd|jjdt|jj|jjdd��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|ddkr�d	|kr�t
|d	��q�t
|j��q�n|jd
t�dS(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYRZR[R`R\i�R]Rd(RrR�R#R7R^RR9R&RUR_RmR`RaRR!RbRwRL(RR5ReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s 

$cC`sq|j�rSdj|jjd|jjdt|jj|jjdd��}n>dj|jjd|jjdt|jj|jj��}d}|jjj	||�}y|j
�}Wn%tk
r�}tt
|���nXd|kr5|ddkr5d	|kr#t|d	��q5t|j��n|j|d
�}td|�}|jtd|��|S(
Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYRZR[s?expandSubcollections=trueR\i�R]R�R5R'(R�R#R7R^RR9R&RUR_R6R`RaRR!RbRWR/RHRO(RReR�RfRgRhR'R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s.

'

cC`s�tdt|jj|jjdd�dd�}dj|jjd|jjd�}|jjj	|d	|�}y|j
�}Wn%tk
r�}tt
|���nXd
|kr�|d
dkr�d
|kr�t|d
��q�t|j��ntS(NRURZR[tcommandR�s#https://{0}:{1}/mgmt/tm/ltm/policy/RXRYR`R\i�i�R](i�i�(RORR9R&RUR#R7R^R_RjR`RaRR!RbRL(RR5ReRfRgRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s$		
cC`sdj|jjd|jjdt|jj|jjdd��}|jjj|�}|j	dkrlt
St|j��dS(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYRZR[i�(
R#R7R^RR9R&RUR_RpRRLRRb(RReRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pytremove_policy_draft_from_device�s

$cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns&https://{0}:{1}/mgmt/tm/ltm/policy/{2}RXRYi�(
R#R7R^RR9R&RUR_RpRRLRRb(RReRg((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pytremove_policy_from_device�s

cC`s6|j�r|j�n|j�r2|j�ntS(N(R�R�R�R�RL(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s


(R)R*R<R�RKR�RNR�RJR�R}RIRHR�R�R�R�R�R�R�R�R�R�(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR��s*																					R�cB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(R9R8(RR9R8((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR<s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RtAttributeErrort_Difference__default(RtparamR((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RR9R8R�(RR�tattr1tattr2((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt	__defaults
cC`s&|jj|jjkr"|jjSdS(N(R9R'R8(R((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR'sN(R)R*RR<R�R�R+R'(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�s			t
ModuleManagercB`s,eZd�Zd�Zd�Zd�ZRS(cO`s7|jdd�|_t|jj�|_||_dS(NR4(R6RR4RR5R7R;(RR:R;((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR<#scC`s7|j�r|jd�}n|jd�}|j�S(Ntsimpletcomplex(tversion_is_less_than_12tget_managerR�(Rtmanager((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�(scC`s6|dkrt|j�S|dkr2t|j�SdS(NR�R�(R~R;R�(Rttype((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�/s
cC`s3t|j�}t|�td�kr+tStSdS(Ns12.1.0(RR7R
RLRM(RR?((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�5s(R)R*R<R�R�R�(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�"s			tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dt�dtdd�dtdd	d
dg�dtd
dddddg�dtd
ddtdgf��}i|_|jjt�|jj|�dS(NRUtrequiredR0R'R�tlistRtchoicesRRRR�tdefaultRJR�RdR&tCommontfallbacktF5_PARTITION(RLtsupports_check_modeROR	t
argument_specRHR(RR�((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR<>s"				(R)R*R<(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyR�=scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�R4R>(
R�RR�R�R�R�t	exit_jsonRt	fail_jsonR!(tspecR4tmmtresultsRh((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pytmainWs		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.icontrolRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont(ansible.module_utils.network.f5.icontrolRR,R/R1R2tobjectR3R~R�R�R�R�R�R)(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_policy.pyt<module>sT


IY
<���1	

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