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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZddlmZddlmZddlmZy�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!Wn�e"k
r�ddl#mZddl$mZddl$mZddl$mZddl$mZddl$mZddl%mZddl&m!Z!nXdefd��YZ'de'fd��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+��YZ0d,�Z1e2d-kr�e1�ndS(.i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bysq
---
module: bigip_pool
short_description: Manages F5 BIG-IP LTM pools
description:
  - Manages F5 BIG-IP LTM pools via iControl REST API.
version_added: 1.2
options:
  description:
    description:
      - Specifies descriptive text that identifies the pool.
    type: str
    version_added: 2.3
  name:
    description:
      - Pool name
    type: str
    required: True
    aliases:
      - pool
  lb_method:
    description:
      - Load balancing method. When creating a new pool, if this value is not
        specified, the default of C(round-robin) will be used.
    type: str
    version_added: 1.3
    choices:
      - dynamic-ratio-member
      - dynamic-ratio-node
      - fastest-app-response
      - fastest-node
      - least-connections-member
      - least-connections-node
      - least-sessions
      - observed-member
      - observed-node
      - predictive-member
      - predictive-node
      - ratio-least-connections-member
      - ratio-least-connections-node
      - ratio-member
      - ratio-node
      - ratio-session
      - round-robin
      - weighted-least-connections-member
      - weighted-least-connections-node
  monitor_type:
    description:
      - Monitor rule type when C(monitors) is specified.
      - When creating a new pool, if this value is not specified, the default
        of 'and_list' will be used.
      - When C(single) ensures that all specified monitors are checked, but
        additionally includes checks to make sure you only specified a single
        monitor.
      - When C(and_list) ensures that B(all) monitors are checked.
      - When C(m_of_n) ensures that C(quorum) of C(monitors) are checked. C(m_of_n)
        B(requires) that a C(quorum) of 1 or greater be set either in the playbook,
        or already existing on the device.
      - Both C(single) and C(and_list) are functionally identical since BIG-IP
        considers all monitors as "a list".
    type: str
    choices:
      - and_list
      - m_of_n
      - single
    version_added: 1.3
  quorum:
    description:
      - Monitor quorum value when C(monitor_type) is C(m_of_n).
      - Quorum must be a value of 1 or greater when C(monitor_type) is C(m_of_n).
    type: int
    version_added: 1.3
  monitors:
    description:
      - Monitor template name list. If the partition is not provided as part of
        the monitor name, then the C(partition) option will be used instead.
    type: list
    version_added: 1.3
  slow_ramp_time:
    description:
      - Sets the ramp-up time (in seconds) to gradually ramp up the load on
        newly added or freshly detected up pool members.
    type: int
    version_added: 1.3
  reselect_tries:
    description:
      - Sets the number of times the system tries to contact a pool member
        after a passive failure.
    type: int
    version_added: 2.2
  service_down_action:
    description:
      - Sets the action to take when node goes down in pool.
    type: str
    choices:
      - none
      - reset
      - drop
      - reselect
    version_added: 1.3
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
    version_added: 2.5
  state:
    description:
      - When C(present), guarantees that the pool exists with the provided
        attributes.
      - When C(absent), removes the pool from the system.
    type: str
    choices:
      - absent
      - present
    default: present
    version_added: 2.5
  metadata:
    description:
      - Arbitrary key/value pairs that you can attach to a pool. This is useful in
        situations where you might want to annotate a pool to me managed by Ansible.
      - Key names will be stored as strings; this includes names that are numbers.
      - Values for all of the keys will be stored as strings; this includes values
        that are numbers.
      - Data will be persisted, not ephemeral.
    type: raw
    version_added: 2.5
  priority_group_activation:
    description:
      - Specifies whether the system load balances traffic according to the priority
        number assigned to the pool member.
      - When creating a new pool, if this parameter is not specified, the default of
        C(0) will be used.
      - To disable this setting, provide the value C(0).
      - Once you enable this setting, you can specify pool member priority when you
        create a new pool or on a pool member's properties screen.
      - The system treats same-priority pool members as a group.
      - To enable priority group activation, provide a number from C(0) to C(65535)
        that represents the minimum number of members that must be available in one
        priority group before the system directs traffic to members in a lower
        priority group.
      - When a sufficient number of members become available in the higher priority
        group, the system again directs traffic to the higher priority group.
    type: int
    aliases:
      - minimum_active_members
    version_added: 2.6
  aggregate:
    description:
      - List of pool definitions to be created, modified or removed.
      - When using C(aggregates) if one of the aggregate definitions is invalid, the aggregate run will fail,
        indicating the error it last encountered.
      - The module will C(NOT) rollback any changes it has made prior to encountering the error.
      - The module also will not indicate what changes were made prior to failure, therefore it is strongly advised
        to run the module in check mode to make basic validation, prior to module execution.
    type: list
    aliases:
      - pools
    version_added: 2.8
  replace_all_with:
    description:
      - Remove pools not defined in the C(aggregate) parameter.
      - This operation is all or none, meaning that it will stop if there are some pools
        that cannot be removed.
    type: bool
    default: no
    aliases:
      - purge
    version_added: 2.8
notes:
  - To add members to a pool, use the C(bigip_pool_member) module. Previously, the
    C(bigip_pool) module allowed the management of members, but this has been removed
    in version 2.5 of Ansible.
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create pool
  bigip_pool:
    state: present
    name: my-pool
    partition: Common
    lb_method: least-connections-member
    slow_ramp_time: 120
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Modify load balancer method
  bigip_pool:
    state: present
    name: my-pool
    partition: Common
    lb_method: round-robin
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Set a single monitor (with enforcement)
  bigip_pool:
    state: present
    name: my-pool
    partition: Common
    monitor_type: single
    monitors:
      - http
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Set a single monitor (without enforcement)
  bigip_pool:
    state: present
    name: my-pool
    partition: Common
    monitors:
      - http
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Set multiple monitors (all must succeed)
  bigip_pool:
    state: present
    name: my-pool
    partition: Common
    monitor_type: and_list
    monitors:
      - http
      - tcp
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Set multiple monitors (at least 1 must succeed)
  bigip_pool:
    state: present
    name: my-pool
    partition: Common
    monitor_type: m_of_n
    quorum: 1
    monitors:
      - http
      - tcp
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Delete pool
  bigip_pool:
    state: absent
    name: my-pool
    partition: Common
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add metadata to pool
  bigip_pool:
    state: present
    name: my-pool
    partition: Common
    metadata:
      ansible: 2.4
      updated_at: 2017-12-20T17:50:46Z
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add pools Aggregate
  bigip_pool:
    aggregate:
      - name: my-pool
        partition: Common
        lb_method: least-connections-member
        slow_ramp_time: 120
      - name: my-pool2
        partition: Common
        lb_method: least-sessions
        slow_ramp_time: 120
      - name: my-pool3
        partition: Common
        lb_method: round-robin
        slow_ramp_time: 120
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add pools Aggregate, purge others
  bigip_pool:
    aggregate:
      - name: my-pool
        partition: Common
        lb_method: least-connections-member
        slow_ramp_time: 120
      - name: my-pool2
        partition: Common
        lb_method: least-sessions
        slow_ramp_time: 120
      - name: my-pool3
        partition: Common
        lb_method: round-robin
        slow_ramp_time: 120
    replace_all_with: yes
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
s�
monitor_type:
  description: The contact that was set on the datacenter.
  returned: changed
  type: str
  sample: [email protected]
quorum:
  description: The quorum that was set on the pool.
  returned: changed
  type: int
  sample: 2
monitors:
  description: Monitors set on the pool.
  returned: changed
  type: list
  sample: ['/Common/http', '/Common/gateway_icmp']
service_down_action:
  description: Service down action that is set on the pool.
  returned: changed
  type: str
  sample: reset
description:
  description: Description set on the pool.
  returned: changed
  type: str
  sample: Pool of web servers
lb_method:
  description: The LB method set for the pool.
  returned: changed
  type: str
  sample: round-robin
slow_ramp_time:
  description: The new value that is set for the slow ramp-up time.
  returned: changed
  type: int
  sample: 500
reselect_tries:
  description: The new value that is set for the number of tries to contact member.
  returned: changed
  type: int
  sample: 10
metadata:
  description: The new value of the pool.
  returned: changed
  type: dict
  sample: {'key1': 'foo', 'key2': 'bar'}
priority_group_activation:
  description: The new minimum number of members to activate the priority group.
  returned: changed
  type: int
  sample: 10
replace_all_with:
  description: Purges all non-aggregate pools from device
  returned: changed
  type: bool
  sample: yes
N(tdeepcopy(turlparse(t
AnsibleModule(tenv_fallback(t	iteritems(tremove_default_spec(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tcmp_str_with_none(tTransactionContextManagert
Parametersc
B`s�eZidd6dd6dd6dd6dd	6d
d6Zdd
dd	dddddg	Zddddddddd	d
ddd
g
Zdddddddddd
g
Zed��Zd�Zed��Z	ed��Z
RS(t	lb_methodtloadBalancingModetslow_ramp_timetslowRampTimetreselect_triest
reselectTriestservice_down_actiontserviceDownActiontmonitorstmonitortpriority_group_activationtminActiveMemberstdescriptiontnametmetadatatmonitor_typetquorumt	partitioncC`sH|jd}|dkrdSt�}||jkrDtd��n|S(NRsProvided lb_method is unknown(t_valuestNonetArgumentSpect	lb_choiceR(tselfRtspec((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�s
	cC`sBy|dkrdSt|�SWntk
r=td��nXdS(Ns*The specified 'quorum' must be an integer.(R*tintt
ValueErrorR(R-R'((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt_verify_quorum_type�s
cC`s�|jddkrdSg|jD]}t|j|�^q!}|jdkrsdj|�}d|j|f}ndj|�j�}|S(NRtm_of_nt smin %s of { %s }s and (	R)R*t
monitors_listRR(R&tjoinR'tstrip(R-txRtresult((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�s(cC`s(|jddkrdSt|jd�S(NR!(R)R*R/(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR!s(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyRR1RR!(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�sV
				
t
ApiParameterscB`sSeZed��Zed��Zed��Zed��Zed��ZRS(cC`s"|jddkrdS|jdS(NR#tnone(NRA(R)R*(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR#scC`sg|jddkrdSd}tj||jd�}|rN|jd�}nd}|j|�}|S(NRsmin\s+(?P<quorum>\d+)\s+ofR'(R)R*tretsearchtgroupR1(R-tpatterntmatchesR'R8((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR'scC`sH|jddkrdSd}tj||jd�}|r@dSdSdS(NRsmin\s+\d+\s+ofR2tand_list(R)R*RBRC(R-RERF((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR&#scC`sX|jddkrgSy!tjd|jd�}|SWntk
rS|jdSXdS(NRs/[\w-]+/[^\s}]+(R)R*RBtfindallt	Exception(R-R8((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR4.s
cC`s�|jddkrdSg}xh|jdD]Y}tdt|d��}d|krmt|d�|d<n
d|d<|j|�q+W|S(NR%R$tvaluet(R)R*tdicttstrtappend(R-R8tmdttmp((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR%8s
(R9R:R?R#R'R&R4R%(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR@s


tModuleParameterscB`sSeZed��Zed��Zed��Zed��Zed��ZRS(cC`s9|jddkrdS|jddkr.dS|jdS(NR#RARK(snoneRK(R)R*(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR#Hs
cC`s"|jddkrgS|jdS(NR(R)R*(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR4PscC`s1|jddkrdS|j|jd�}|S(NR'(R)R*R1(R-R8((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR'VscC`s"|jddkrdS|jdS(NR&(R)R*(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR&]scC`s�|jddkrdS|jddkr.gSg}ymxft|jd�D]Q\}}tdt|��}|r�t|�|d<n
d|d<|j|�qKWWntk
r�td��nX|S(NR%RKR$RJsAThe 'metadata' parameter must be a dictionary of key/value pairs.(R)R*RRLRMRNtAttributeErrorR(R-R8tktvRP((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR%cs  


(R9R:R?R#R4R'R&R%(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRQGs
tChangescB`s eZd�Zed��ZRS(cC`sXi}xK|jD]@}yt||�||<Wntk
r@nX|j|�}qW|S(N(R=tgetattrRIt_filter_params(R-R8t
returnable((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt	to_returnzs
cC`s"|jddkrdS|jdS(NR(R)R*(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�s(R9R:RYR?R(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRUys	
t
UsableChangescB`seZed��ZRS(cC`sd|jd}|dkrdSd|kr`dr`|jd�jd�}dj|�j�}|S|S(NRt{t}RK(R)R*R6tsplitR5trstrip(R-tmonitor_stringRPR ((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�s
(R9R:R?R(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRZ�stReportableChangescB`s5eZed��Zed��Zed��ZRS(cC`s#ttjd|jd��}|S(Ns/[\w-]+/[^\s}]+R(tsortedRBRHR)(R-R8((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�scC`s1d}tj||jd�}|r)dSdSdS(Nsmin\s+\d+\s+ofRR2RG(RBRCR)(R-RERF((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR&�s
cC`s7t�}x'|jdD]}|d||d<qW|S(NR%RJR$(RLR)(R-R8R7((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR%�s	(R9R:R?RR&R%(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR`�s	t
DifferencecB`s�eZdd�Zd�Zd�Zd�Zd�Zed��Z	d�Z
ed��Zed��Zed	��Z
ed
��ZRS(cC`s||_||_dS(N(twantthave(R-RcRd((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RVRRt_Difference__default(R-tparamR8((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RVRcRdRR(R-Rgtattr1tattr2((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt	__default�s
cC`s\g}xO|D]G}gt|�D]$\}}t|�t|�f^q }||7}q
W|S(N(RRM(R-titemsR8R7RSRTRP((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pytto_tuple�s

7cC`sq|gkr|dkrdS|dkr,dS|j|�}|j|�}t|�jt|��ridS|SdS(N(R*Rmtsettissubset(R-RcRdtwth((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt_diff_complex_items�scC`st|jj|jj�S(N(RRcR#Rd(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR#�scC`s|jjdkr4|jjtd|jj��n|jjdkr�|jjdkrz|jjtd|jj��n|jjdks�|jjdkr�td��n|jj|jjkr�td|jj�Sn|jjdkrN|jjdk	r |jjdkr td	��n|jj|jjkr�td|jj�Sn�|jjd
kr�t	|jj
�dkr�td��n?t	|jj
�dkr�t	|jj
�dkr�td��n|jjtdd��n|jj|jjkr
td|jj�SdS(
NR&R2R'is:Quorum value must be specified with monitor_type 'm_of_n'.RRGis7Quorum values have no effect when used with 'and_list'.tsinglesJWhen using a 'monitor_type' of 'single', only one monitor may be provided.sZA single monitor must be specified if more than one monitor currently exists on your pool.(RcR&R*tupdateRLRdR'RRtlenR4(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt_monitors_and_quorum�s:""$$0cC`s
|j�S(N(Rv(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR&scC`s
|j�S(N(Rv(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR'scC`s�|jjdkr4|jjtd|jj��n|jjsU|jj|j_n|jjr�|jjdk	r�td��n|jj|jjkr�|jjSdS(NR&sSThe 'monitors' parameter cannot be empty when 'monitor_type' parameter is specified(	RcR&R*RtRLRdR4RR(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRs"cC`s�|jjdkrdSt|jj�dkrD|jjdkrDdSt|jj�dkr`gS|jjdkr||jjS|j|jj|jj�}|S(Ni(RcR%R*RuRdRr(R-R8((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR%!s*
N(R9R:R*ReRhRfRmRrR?R#RvR&R'RR%(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRb�s						/
t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zdd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cO`s^|jdd�|_t|jj�|_d|_d|_d|_d|_	t
�|_dS(Ntmodule(tgetR*RxRtparamstclientRcRdtchangestreplace_all_withtlisttpurge_links(R-targstkwargs((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRe0s				cC`s6d}|jjdr"t|_n|jjdrJ|j|jj�}nt�}t}|jr~|jr~|j	�t}n|jjdr�t
�|d<x�|D]=}|j|�}|dr�|d}n|dj|�q�Wn9|j|jj�}|dr|d}n|j
|�|r2t|d<n|S(NR}t	aggregatetchanged(R*RxRztTrueR}tmerge_defaults_for_aggregateRLtFalseRtpurgeR~texecuteRNRt(R-twantsR8R�Rctoutput((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pytexec_module9s0	
	







cC`s�t|�}|jd�}x{t|�D]m\}}x^t|�D]P\}}|dkrA|j|d�dkr�|dk	r�||||<q�qAqAWq(W|jr�|j|�n|S(NR�R}(Rtpopt	enumerateRRyR*R}tcompare_aggregate_names(R-RztdefaultsR�titjRSRT((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�Xs$	cC`s�|j�}|stSg|D]}|d^q}g|D]}|d^q:}t|�t|�}|r�g|D] }|d|krs|d^qs}|jj|�ndS(NR$tselfLink(t_read_purge_collectionR�RnRtextend(R-Rlt	on_devicetitemt
aggregatest
collectiontdifftto_purge((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�gs-cC`s�td|�|_t�|_t�|_t}t�}|d}|dkr^|j�}n|dkry|j	�}nt
d|jj��}|j�}|j|�|jtd|��|j
|�|S(NRztstatetpresenttabsentR�(RQRcR@RdRZR|R�RLR�R�R`RYRtt_announce_deprecations(R-RzR�R8R�t
reportableR|((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�ts 	


cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(R�Rxt	deprecate(R-R8twarningstwarning((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR��s


cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRz(RR=RVRcR*RZR|(R-R�tkey((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.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(NRz(RbRcRdRR>RLRhR*t
isinstanceRtRZR|R�R�(R-R�R>R�RStchange((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt_update_changed_options�s		
cC`s$|j�r|j�S|j�SdS(N(texistsRttcreate(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR��s
cC`s|j�r|j�StS(N(R�tremoveR�(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR��s
cC`s|j�}|rtStS(N(R�R�R�(R-R8((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt
should_update�scC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRdR�R�Rxt
check_modeR�tupdate_on_device(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRt�s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the Pool(RxR�R�tremove_from_deviceR�R(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR��s
cC`s|jjrtS|j�tS(N(RxR�R�tpurge_from_device(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR��s
c	C`su|jjdk	r0|jjs^td��q^n.|jjdkr^|jjtdd��n|jjdkr�|jjdks�|jjdkr�td��n~|jjdkr�|jjdk	r�|jjdkr�td��n9|jjd	kr!t|jj�dkr!td
��n|jj	dkrM|jjidd6�n|j
�|jjrgt
S|j�t
S(NsSThe 'monitors' parameter cannot be empty when 'monitor_type' parameter is specifiedR&RGR2is:Quorum value must be specified with monitor_type 'm_of_n'.is7Quorum values have no effect when used with 'and_list'.RssIWhen using a 'monitor_type' of 'single', only one monitor may be providedR!(RcR&R*R4RRtRLR'RuR!R�RxR�R�tcreate_on_device(R-((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR��s,66*

cC`s�dj|jjd|jjd�}d}|jjj||�}y|j�}Wn%tk
r|}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��nd|kr�|dSgS(	Ns!https://{0}:{1}/mgmt/tm/ltm/pool/tservertserver_ports?$select=name,selfLinktcodei�tmessageRl(
tformatR{tprovidertapiRytjsonR0RRMtcontent(R-turitquerytresptresponsetex((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR��s 
cC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��ndS(NR$R(s!https://{0}:{1}/mgmt/tm/ltm/pool/R�R�R�R�i�i�R�(i�i�(R|t
api_paramsRcR$R(R�R{R�R�tpostR�R0RRMR�(R-RzR�R�R�R�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�	s
cC`s�|jj�}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��ndS(Ns$https://{0}:{1}/mgmt/tm/ltm/pool/{2}R�R�R�R�i�R�(R|R�R�R{R�RRcR(R$R�tpatchR�R0RRMR�(R-RzR�R�R�R�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�s

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/pool/{2}R�R�i�R�(R�R{R�RRcR(R$R�RyR�R0R�RR�(R-R�R�R�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�0s


+cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns$https://{0}:{1}/mgmt/tm/ltm/pool/{2}R�R�i�(
R�R{R�RRcR(R$R�tdeleteRR�RR�(R-R�R�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�?s

cC`s�dj|jjd|jjdt|jj|jj��}d}|jjj||�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd|�S(	Ns$https://{0}:{1}/mgmt/tm/ltm/pool/{2}R�R�s?expandSubcollections=trueR�i�R�Rz(R�R{R�RRcR(R$R�RyR�R0RRMR�R@(R-R�R�R�R�R�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�Js

cC`svt�}g|D]}t|�j^q}xD|D]<}dj|jjd|jjd|�}|j|�q2W|S(Nshttps://{0}:{1}{2}R�R�(R~R	tpathR�R{R�RN(R-R�Rtlinktpurge_pathsR�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt_prepare_links^s	"


	c
C`s�|j|j�}t|j���}x�|D]�}|jj|�}y|j�}Wn%tk
rz}tt	|���nXd|kr+|ddkr+d|kr�t|d��q�t|j
��q+q+WWdQXtS(NR�i�R�(R�RRR{R�R�R�R0RRMR�R�(R-tlinksttransactR�R�R�R�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR�ks
N(R9R:ReR�R�R�R*R�R�R�R�R�R�R�RtR�R�R�R�R�R�R�R�R�R�R�(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRw/s.					
																		
R+cB`seZd�ZRS(c C`s0ddddddddd	d
ddd
ddddddg|_t|_tdtddg�dtd|j�dtddddg�dtdd�d tdd!�d"tdd�d#tdd�d$tdd%d&d'd(g�d)t�d*tdd+�d,td-d.dd.d/g�d0tdddd1g�d2td-d3d4td5gf��
}t|�}t|�td6tdd!d7d8d9|dd:g�d2td-d3d4td5gf�d;td-d<dd=dd>g��}dd6gg|_dd6gg|_i|_	|j	j
|�|j	j
t�|j	j
|�dS(?Nsdynamic-ratio-membersdynamic-ratio-nodesfastest-app-responsesfastest-nodesleast-connections-membersleast-connections-nodesleast-sessionssobserved-members
observed-nodespredictive-memberspredictive-nodesratio-least-connections-membersratio-least-connections-nodesratio-members
ratio-nodes
ratio-sessionsround-robins!weighted-least-connections-membersweighted-least-connections-nodeR$taliasestpoolRtchoicesR&RGR2RsR'ttypeR/RR~RRRRAtresettdroptreselectR#R%trawR�tdefaultR�R�R!tminimum_active_membersR(tCommontfallbacktF5_PARTITIONR�telementsRLtoptionstpoolsR}tnotboolR�(R,R�tsupports_check_modeRLRRR
tmutually_exclusivetrequired_one_oft
argument_specRtR(R-telement_spectaggregate_specR�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyRe�s�						
	(R9R:Re(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyR+sc	C`s�t�}td|jd|jd|jd|j�}y,td|�}|j�}|j|�Wn)t	k
r�}|j
dt|��nXdS(NR�R�R�R�RxR�(R+R
R�R�R�R�RwR�t	exit_jsonRt	fail_jsonRM(R.RxtmmtresultsR�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pytmain�s				t__main__(3t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRBtcopyRtansible.module_utils.urlsR	tansible.module_utils.basicR
Rtansible.module_utils.sixRt)ansible.module_utils.network.common.utilsR
t%library.module_utils.network.f5.bigipRt&library.module_utils.network.f5.commonRRRRRt'library.module_utils.network.f5.compareRt(library.module_utils.network.f5.icontrolRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.comparet(ansible.module_utils.network.f5.icontrolRR@RQRURZR`tobjectRbRwR+R�R9(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool.pyt<module>sZ


��:
[82~�Qj	

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