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

�
�Udac@`saddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZddlmZddlmZddlmZy�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddl!m"Z"ddl#m$Z$ddl#m%Z%ddl&m'Z'Wn�e(k
raddl)mZddl*mZddl*mZddl*mZddl*mZddl*mZddl*mZddl*m Z ddl+m"Z"ddl,m$Z$ddl,m%Z%ddl-m'Z'nXdefd��YZ.d e.fd!��YZ/d"e.fd#��YZ0d$e.fd%��YZ1d&e.fd'��YZ2d(e2fd)��YZ3d*e2fd+��YZ4d,e5fd-��YZ6d.e5fd/��YZ7d0e5fd1��YZ8d2�Z9e:d3kr]e9�ndS(4i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bysY
---
module: bigip_pool_member
short_description: Manages F5 BIG-IP LTM pool members
description:
  - Manages F5 BIG-IP LTM pool members via iControl SOAP API.
version_added: 1.4
options:
  name:
    description:
      - Name of the node to create, or re-use, when creating a new pool member.
      - This parameter is optional and, if not specified, a node name will be
        created automatically from either the specified C(address) or C(fqdn).
      - The C(enabled) state is an alias of C(present).
    type: str
    version_added: 2.6
  state:
    description:
      - Pool member state.
    type: str
    required: True
    choices:
      - present
      - absent
      - enabled
      - disabled
      - forced_offline
    default: present
  pool:
    description:
      - Pool name. This pool must exist.
    type: str
    required: True
  partition:
    description:
      - Partition to manage resources on.
    type: str
    default: Common
  address:
    description:
      - IP address of the pool member. This can be either IPv4 or IPv6. When creating a
        new pool member, one of either C(address) or C(fqdn) must be provided. This
        parameter cannot be updated after it is set.
    type: str
    aliases:
      - ip
      - host
    version_added: 2.2
  fqdn:
    description:
      - FQDN name of the pool member. This can be any name that is a valid RFC 1123 DNS
        name. Therefore, the only characters that can be used are "A" to "Z",
        "a" to "z", "0" to "9", the hyphen ("-") and the period (".").
      - FQDN names must include at lease one period; delineating the host from
        the domain. ex. C(host.domain).
      - FQDN names must end with a letter or a number.
      - When creating a new pool member, one of either C(address) or C(fqdn) must be
        provided. This parameter cannot be updated after it is set.
    type: str
    aliases:
      - hostname
    version_added: 2.6
  port:
    description:
      - Pool member port.
      - This value cannot be changed after it has been set.
    type: int
    required: True
  connection_limit:
    description:
      - Pool member connection limit. Setting this to 0 disables the limit.
    type: int
  description:
    description:
      - Pool member description.
    type: str
  rate_limit:
    description:
      - Pool member rate limit (connections-per-second). Setting this to 0
        disables the limit.
    type: int
  ratio:
    description:
      - Pool member ratio weight. Valid values range from 1 through 100.
        New pool members -- unless overridden with this value -- default
        to 1.
    type: int
  preserve_node:
    description:
      - When state is C(absent) attempts to remove the node that the pool
        member references.
      - The node will not be removed if it is still referenced by other pool
        members. If this happens, the module will not raise an error.
      - Setting this to C(yes) disables this behavior.
    type: bool
    version_added: 2.1
  priority_group:
    description:
      - Specifies a number representing the priority group for the pool member.
      - When adding a new member, the default is 0, meaning that the member has no priority.
      - To specify a priority, you must activate priority group usage when you
        create a new pool or when adding or removing pool members. When activated,
        the system load balances traffic according to the priority group number
        assigned to the pool member.
      - The higher the number, the higher the priority, so a member with a priority
        of 3 has higher priority than a member with a priority of 1.
    type: int
    version_added: 2.5
  fqdn_auto_populate:
    description:
      - Specifies whether the system automatically creates ephemeral nodes using
        the IP addresses returned by the resolution of a DNS query for a node
        defined by an FQDN.
      - When C(yes), the system generates an ephemeral node for each IP address
        returned in response to a DNS query for the FQDN of the node. Additionally,
        when a DNS response indicates the IP address of an ephemeral node no longer
        exists, the system deletes the ephemeral node.
      - When C(no), the system resolves a DNS query for the FQDN of the node
        with the single IP address associated with the FQDN.
      - When creating a new pool member, the default for this parameter is C(yes).
      - Once set this parameter cannot be changed afterwards.
      - This parameter is ignored when C(reuse_nodes) is C(yes).
    type: bool
    version_added: 2.6
  reuse_nodes:
    description:
      - Reuses node definitions if requested.
    type: bool
    default: yes
    version_added: 2.6
  monitors:
    description:
      - Specifies the health monitors that the system currently uses to monitor
        this resource.
    type: list
    version_added: 2.8
  availability_requirements:
    description:
      - Specifies, if you activate more than one health monitor, the number of health
        monitors that must receive successful responses in order for the link to be
        considered available.
      - Specifying an empty string will remove the monitors and revert to inheriting from pool (default).
      - Specifying C(none) value will remove any health monitoring from the member completely.
    suboptions:
      type:
        description:
          - Monitor rule type when C(monitors) is specified.
          - When creating a new pool, if this value is not specified, the default of
            'all' will be used.
        type: str
        choices:
          - all
          - at_least
      at_least:
        description:
          - Specifies the minimum number of active health monitors that must be successful
            before the link is considered up.
          - This parameter is only relevant when a C(type) of C(at_least) is used.
          - This parameter will be ignored if a type of C(all) is used.
        type: int
    type: dict
    version_added: 2.8
  ip_encapsulation:
    description:
      - Specifies the IP encapsulation using either IPIP (IP encapsulation within IP,
        RFC 2003) or GRE (Generic Router Encapsulation, RFC 2784) on outbound packets
        (from BIG-IP system to server-pool member).
      - When C(none), disables IP encapsulation.
      - When C(inherit), inherits IP encapsulation setting from the member's pool.
      - When any other value, Options are None, Inherit from Pool, and Member Specific.
    type: str
    version_added: 2.8
  aggregate:
    description:
      - List of pool member 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:
      - members
    version_added: 2.8
  replace_all_with:
    description:
      - Remove members not defined in the C(aggregate) parameter.
      - This operation is all or none, meaning that it will stop if there are some pool members
        that cannot be removed.
    type: bool
    default: no
    aliases:
      - purge
    version_added: 2.8
notes:
  - In previous versions of this module, which used the SDK, the C(name) parameter would act as C(fqdn) if C(address) or
    C(fqdn) were not provided.
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s

- name: Add pool member
  bigip_pool_member:
    pool: my-pool
    partition: Common
    host: "{{ ansible_default_ipv4['address'] }}"
    port: 80
    description: web server
    connection_limit: 100
    rate_limit: 50
    ratio: 2
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Modify pool member ratio and description
  bigip_pool_member:
    pool: my-pool
    partition: Common
    host: "{{ ansible_default_ipv4['address'] }}"
    port: 80
    ratio: 1
    description: nginx server
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Remove pool member from pool
  bigip_pool_member:
    state: absent
    pool: my-pool
    partition: Common
    host: "{{ ansible_default_ipv4['address'] }}"
    port: 80
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Force pool member offline
  bigip_pool_member:
    state: forced_offline
    pool: my-pool
    partition: Common
    host: "{{ ansible_default_ipv4['address'] }}"
    port: 80
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Create members with priority groups
  bigip_pool_member:
    pool: my-pool
    partition: Common
    host: "{{ item.address }}"
    name: "{{ item.name }}"
    priority_group: "{{ item.priority_group }}"
    port: 80
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
  loop:
    - address: 1.1.1.1
      name: web1
      priority_group: 4
    - address: 2.2.2.2
      name: web2
      priority_group: 3
    - address: 3.3.3.3
      name: web3
      priority_group: 2
    - address: 4.4.4.4
      name: web4
      priority_group: 1

- name: Add pool members aggregate
  bigip_pool_member:
    pool: my-pool
    aggregate:
      - host: 192.168.1.1
        partition: Common
        port: 80
        description: web server
        connection_limit: 100
        rate_limit: 50
        ratio: 2
      - host: 192.168.1.2
        partition: Common
        port: 80
        description: web server
        connection_limit: 100
        rate_limit: 50
        ratio: 2
      - host: 192.168.1.3
        partition: Common
        port: 80
        description: web server
        connection_limit: 100
        rate_limit: 50
        ratio: 2
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add pool members aggregate, remove non aggregates
  bigip_pool_member:
    pool: my-pool
    aggregate:
      - host: 192.168.1.1
        partition: Common
        port: 80
        description: web server
        connection_limit: 100
        rate_limit: 50
        ratio: 2
      - host: 192.168.1.2
        partition: Common
        port: 80
        description: web server
        connection_limit: 100
        rate_limit: 50
        ratio: 2
      - host: 192.168.1.3
        partition: Common
        port: 80
        description: web server
        connection_limit: 100
        rate_limit: 50
        ratio: 2
    replace_all_with: yes
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
s�
rate_limit:
  description: The new rate limit, in connections per second, of the pool member.
  returned: changed
  type: int
  sample: 100
connection_limit:
  description: The new connection limit of the pool member
  returned: changed
  type: int
  sample: 1000
description:
  description: The new description of pool member.
  returned: changed
  type: str
  sample: My pool member
ratio:
  description: The new pool member ratio weight.
  returned: changed
  type: int
  sample: 50
priority_group:
  description: The new priority group.
  returned: changed
  type: int
  sample: 3
fqdn_auto_populate:
  description: Whether FQDN auto population was set on the member or not.
  returned: changed
  type: bool
  sample: True
fqdn:
  description: The FQDN of the pool member.
  returned: changed
  type: str
  sample: foo.bar.com
address:
  description: The address of the pool member.
  returned: changed
  type: str
  sample: 1.2.3.4
monitors:
  description: The new list of monitors for the resource.
  returned: changed
  type: list
  sample: ['/Common/monitor1', '/Common/monitor2']
replace_all_with:
  description: Purges all non-aggregate pool members 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(ttransform_name(tf5_argument_spec(tis_valid_hostname(tflatten_boolean(tcmp_str_with_none(tis_valid_ip(tvalidate_ip_v6_address(tTransactionContextManagert
Parametersc
B`s�eZidd6dd6dd6dd6dd	6d
d6Zdddd
ddddddd	dgZdddd
ddddddddd
g
Zdddd
dddddd
g
ZRS(t
rate_limitt	rateLimittconnection_limittconnectionLimittpriority_groupt
priorityGrouptmonitorstmonitortinherit_profiletinheritProfiletip_encapsulationtprofilestdescriptiontratiotaddresstfqdntsessiontstatetfqdn_auto_populate(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�sT
		tModuleParameterscB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed	��Zed
��Z
ed��Zed��Zed
��Zd�ZRS(cC`sWd}y t|jd�r%d}nWntk
r9nXdj|jd||j�S(Nt:tnamet.s	{0}{1}{2}(Rtfull_name_dictt	TypeErrortformattport(tselft	delimiter((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt	full_names

cC`s`|jddkr=|jdr-|jdn
|jd}n
|jd}td|d|j�S(NR6R)R*R;(t_valuestNonetdictR;(R<R6((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR8s*
cC`s|jdS(NR6(R8(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt	node_namescC`s|jdS(NR*(R?(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt	fqdn_name scC`s�i}|jrd|d<n
d|d<|jddkr=|St|jd�sotdj|jd���n|jd|d<|S(NtenabledtautopopulatetdisabledR*s;The specified 'fqdn' value of: {0} is not a valid hostname.ttmName(R-R?R@RRR:(R<tresult((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR*$s	

cC`st|jj|jd�S(Ntpool(Rtwantt	partitionR?(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRI4scC`st|jddkr"td��ndt|jd�ksTt|jd�dkrctd��nt|jd�S(NR;sPort value must be specified.ii��s&Valid ports must be in range 0 - 65535(R?R@Rtint(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR;8s2cC`sx|jddkrdS|jddkr.dS|jdjd�d}t|�r_|jdStdj|���dS(NR)tany6t%is@The specified 'address' value of: {0} is not a valid IP address.(R?R@tsplitRRR:(R<R)((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR)DscC`s"|jddkrdS|jdS(NR,RDtpresent(R?(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR,QscC`sb|jddkrgSy+tjd|jd�}|j�|SWntk
r]|jdSXdS(NR!s/\w+/[^\s}]+(R?R@tretfindalltsortt	Exception(R<RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt
monitors_listWs

cC`s|jddkrdSt|jd�dkrK|jdddkrKdSt|jd�dkr|jdddkrdSg|jD]}t|j|�^q�}|jdkr|jt|j�kr�td	��nd
j	|�}dj
|j|�}ndj	|�j�}|S(
NR!iittdefaulttnones/Common/nonetat_leasts>The 'at_least' value must not exceed the number of 'monitors'.t smin {0} of {{ {1} }}s and (R?R@tlenRURRKtavailability_requirement_typeRYRtjoinR:tstrip(R<txR!RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR!bs00(cC`s&|jddkrdS|jddS(Ntavailability_requirementsttype(R?R@(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR\vscC`s
|jd�S(NRY(t_get_availability_value(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRY|scC`s\|jddkrdS|jddkr.dS|jddkrEdSt|j|jd�S(NR%tinheritRVRX(RVsnone(R?R@RRK(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR%�scC`sG|jddkrdS|jd|dkr2dSt|jd|�S(NR`(R?R@RL(R<Ra((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRb�s
(R.R/tpropertyR>R8RBRCR*RIR;R)R,RUR!R\RYR%Rb(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR4s


t
ApiParameterscB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed	��Zed
��Z
RS(cC`s�|jdd	kr&|jdkr&dS|jdd	krL|jdkrLdS|jdd	krcd	S|jdd}t|d|d�S(
sReturns a simple name for the tunnel.

        The API stores the data like so

            "profiles": [
                {
                    "name": "gre",
                    "partition": "Common",
                    "nameReference": {
                        "link": "https://localhost/mgmt/tm/net/tunnels/gre/~Common~gre?ver=13.1.0.7"
                    }
                }
            ]

        This method returns that data as a simple profile name. For instance,

            /Common/gre

        This allows us to do comparisons of it in the Difference class and then,
        as needed, translate it back to the more complex form in the UsableChanges
        class.

        Returns:
            string: The simple form representation of the tunnel
        R%tyesRctnoRViRKR6N(R?R@R#R(R<ttunnel((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR%�s""cC`st|jd�S(NR#(RR?(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR#�scC`sz|jddkrdS|jdddkr2dS|jd}ttg|D]}t|�^qL��}t|�}|S(NtallowRVitAlltall(R?R@tlisttsettstrtsorted(R<RiR_RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRi�s
+cC`s?|jddkrdS|jddkr.dSt|jd�S(NRRFi(R?R@RL(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�s
cC`s�|jddkr*|jddkr*dS|jddkrT|jddkrTdS|jddkr~|jddkr~dSdSdS(NR,suser-upt	uncheckedsfqdn-up-no-addrsfqdn-upR+suser-enabledRPtdowntuptcheckingsmonitor-enableds	user-downs
user-disabledtforced_offlineRF(suser-upRpsfqdn-up-no-addrsfqdn-up(suser-enabled(RqRrRs(s	user-down(s
user-disabled(R?(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR,�s&&
&cC`s6|jddkrdSd|jdkr.dSdSdS(NR!smin RYRk(R?R@(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR\�s
cC`sb|jddkrgSy+tjd|jd�}|j�|SWntk
r]|jdSXdS(NR!s/\w+/[^\s}]+(R?R@RQRRRSRT(R<RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRU�s

cC`s�|jddkrdS|jddkr.dSg|jD]}t|j|�^q8}|jdkr�dj|�}dj|j|�}ndj|�j	�}|S(NR!RWRYRZsmin {0} of {{ {1} }}s and (
R?R@RURRKR\R]R:RYR^(R<R_R!RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR!�s(cC`sS|jddkrdSd}tj||jd�}|dkrFdS|jd�S(s�Returns the 'at least' value from the monitor string.
        The monitor string for a Require monitor looks like this.
            min 1 of { /Common/gateway_icmp }
        This method parses out the first of the numeric values. This values represents
        the "at_least" value that can be updated in the module.
        Returns:
             int: The at_least value if found. None otherwise.
        R!smin\s+(?P<least>\d+)\s+of\s+tleastN(R?R@RQtsearchtgroup(R<tpatterntmatches((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRYs
cC`sM|jddkrdSd|jdkrI|jdddkrEtStSdS(NR*RERD(R?R@tTruetFalse(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR-scC`s=|jddkrdSd|jdkr9|jddSdS(NR*RG(R?R@(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR*#s(R.R/RdR%R#RiRR,R\RUR!RYR-R*(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRe�s'		tNodeApiParameterscB`seZRS((R.R/(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR|+stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R2tgetattrt_filter_paramsRT(R<RHt
returnable((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt	to_return0s
(R.R/R�(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR}/st
UsableChangescB`seZed��ZRS(cC`sd|jd}|dkrdSd|kr`dr`|jd�jd�}dj|�j�}|S|S(NR!t{t}RV(R?R@R^ROR]trstrip(R<tmonitor_stringttmpR"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR!<s
(R.R/RdR!(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�;stReportableChangescB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
RS(cC`sGdjttjjd���}|jd|kr8dS|jdSdS(NR5tssl_cipher_suiteRW(R]RoRt_ciphersROR?(R<RW((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�Is!cC`sM|jddkrdSd|jdkrI|jdddkrEtStSdS(NR*RERD(R?R@RzR{(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR-QscC`s=|jddkrdSd|jdkr9|jddSdS(NR*RG(R?R@(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR*ZscC`s�|jddkr*|jddkr*dS|jddkrT|jddkrTdS|jddkr~|jddkr~dSdSdS(NR,suser-upRpsfqdn-up-no-addrsfqdn-upR+suser-enabledRPRqRrRssmonitor-enableds	user-downs
user-disabledRtRF(suser-ups	uncheckedsfqdn-up-no-addrsfqdn-up(suser-enabled(sdownsupschecking(s	user-down(s
user-disabled(R?(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR,as&&&cC`sb|jddkrgSy+tjd|jd�}|j�|SWntk
r]|jdSXdS(NR!s/\w+/[^\s}]+(R?R@RQRRRSRT(R<RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR!ls

cC`s6|jddkrdSd|jdkr.dSdSdS(NR!smin RYRk(R?R@(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR\ws
cC`sY|jddkrdSd}tj||jd�}|dkrFdSt|jd��S(s�Returns the 'at least' value from the monitor string.
        The monitor string for a Require monitor looks like this.
            min 1 of { /Common/gateway_icmp }
        This method parses out the first of the numeric values. This values represents
        the "at_least" value that can be updated in the module.
        Returns:
             int: The at_least value if found. None otherwise.
        R!smin\s+(?P<least>\d+)\s+of\s+RuN(R?R@RQRvRLRw(R<RxRy((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRY�s
cC`s>|jddkrdSt�}|j|d<|j|d<|S(NR!RaRY(R?R@RAR\RY(R<RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR`�s	

(R.R/RdR�R-R*R,R!R\RYR`(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�Hs		t
DifferencecB`sbeZdd�Zd�Zd�Zed��Zed��Zed��Z	ed��Z
RS(cC`s||_||_dS(N(RJthave(R<RJR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R~tAttributeErrort_Difference__default(R<tparamRH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R~RJR�R�(R<R�tattr1tattr2((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt	__default�s
cC`s�|jj|jjkrdS|jjdkr@idd6dd6S|jjdkrdidd6dd6S|jjdkr�idd6d
d6SdS(NRts	user-downR,s
user-disabledR+RFsuser-upRPRDsuser-enabled(spresentsenabled(RJR,R�R@(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR,�scC`s@|jjdk	r<|jj|jjkr<td��q<ndS(Ns>The fqdn_auto_populate cannot be changed once it has been set.(RJR-R@R�R(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR-�scC`s�|jjdkrdS|jjdkr>|jjdkr>dS|jjdkrf|jjdkrfdS|jjdkr�t|jj�dkr�dS|jjdkr�|jjdkr�dS|jjdkr�|jjS|jj|jjkr�|jjSdS(NRWis/Common/nones
/Common/none (s/Common/nones
/Common/none (RJR!R@R�R[(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR!�s$$*$
c
C`s�t|jj|jj�}|dkr+dS|dkrJtdddg�S|dkritdddg�Stdddtdtjj|�j	d	�d
tjj
|��g�SdS(NRcR#RDR%RVRXRFR6t/RK(RVsnone(RRJR%R�R@RAtostpathtbasenameR^tdirname(R<RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR%�s N(R.R/R@R�R�R�RdR,R-R!R%(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s			t
ModuleManagercB`s=eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd"d
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d �Z#d!�Z$RS(#cO`sg|jdd�|_t|jj�|_d|_d|_d|_t	|_
t�|_d|_
dS(Ntmodule(tgetR@R�RtparamstclientRJR�tchangesR{treplace_all_withRltpurge_linkst	on_device(R<targstkwargs((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s				cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR�(RR2R~RJR@R�R�(R<tchangedtkey((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt_set_changed_optionss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�(R�RJR�RR3RAR�R@t
isinstancetupdateR�R�RzR{(R<tdiffR3R�tktchange((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt_update_changed_options
s		
cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR�t	deprecate(R<RHtwarningstwarning((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt_announce_deprecationss


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	aggregateR�(R@R�R�RzR�tmerge_defaults_for_aggregateRAR{R�tpurgeRltexecutetappendR�(R<twantsRHR�RJtoutput((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pytexec_module's0	
	







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�(RR�t	enumerateRR�R@R�tcompare_aggregate_names(R<R�tdefaultsR�titjR�tv((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�Fs$	cC`sO|j�}|sg|_dSg|D]}|ddkr&|^q&|_dS(Nt	ephemeralttrue(t_read_purge_collectionR�(R<R�tmember((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt_filter_ephemeralsUs
	cC`s�td�|D��r�g|D]&}d|kr|dr|d^q}g|jD]$}d|dkrS|dd^qS}t|�t|�}|r�g|jD]4}d|dkr�|dd|kr�|d^q�}|jj|�tStStS(Ncs`s|]}d|kVqdS(R*N((t.0titem((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pys	<genexpr>]sR*RGtselfLink(tanyR�RmR�textendRzR{(R<titemsR�t
aggregatesR�t
collectionR�tfqdns((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt
compare_fqdns\s34DcC`s�td�|D��r�g|D]&}d|kr|dr|d^q}g|jD]}|d^qS}t|�t|�}|r�g|jD] }|d|kr�|d^q�}|jj|�tStStS(Ncs`s|]}d|kVqdS(R)N((R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pys	<genexpr>lsR)R�(R�R�RmR�R�RzR{(R<R�R�R�R�R�R�t	addresses((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pytcompare_addressesks3 0cC`s�|j�|jstS|j|�}|j|�}|jr�|r�|s�|jjg|jD] }d|dkr]|d^q]�q�q�ndS(NRGR*R�(R�R�R{R�R�R�R�(R<R�R�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�xs
		cC`s�td|�|_t�|_t�|_t}t�}|d}|d	kr^|j�}n|dkry|j	�}nt
d|jj��}|j�}|j|�|jtd|��|j
|�|S(
NR�R,RPRDRFRttabsentR�(spresentsenabledsdisabledsforced_offline(R4RJReR�R�R�R{RARPR�R�R�R�R�(R<R�R�RHR,t
reportableR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s 	


cC`s$|j�r|j�S|j�SdS(N(texistsR�tcreate(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyRP�s
cC`s=|j�r|j�S|jjr9|j�r9|j�StS(N(R�tremoveRJt
preserve_nodetnode_existstremove_node_from_deviceR{(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s


cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR�t
should_updateR{R�t
check_modeRztupdate_on_device(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s
cC`s|j�}|rtStS(N(R�RzR{(R<RH((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��scC`sR|jjrtS|j�|jjs3|j�n|j�rNtd��ntS(NsFailed to delete the resource.(	R�R�Rztremove_from_deviceRJR�R�R�R(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s

cC`s9|jjrtS|j�s+td��n|j�tS(Ns!The specified pool does not exist(R�R�Rzt
pool_existRtpurge_from_device(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s
cC`s?|jjr|j�n|jjr[td�|jj|jjgD��r[|j�n|jjdkr�|j	j
idd6�|j	j
igd6�no|jjr
|jd�}|jd�}||}|jj|kr�td��n|j	j
id	d6�n|j
�|j�|jjr1tS|j�tS(
Ncs`s|]}|VqdS(N((R�R_((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pys	<genexpr>�sRVRDR#R&tgretipipsDThe specified 'ip_encapsulation' tunnel was not found on the system.RF(RJtreuse_nodest#_update_address_with_existing_nodesR6R�R)RCt_set_host_by_nameR%R�R�t read_current_tunnels_from_deviceRt_update_api_state_attributesR�R�R�Rztcreate_on_device(R<ttunnels_grettunnels_ipipttunnels((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s*
5




cC`s�|j�std��ndj|jjd|jjdtdt|jj|jj	��t|jj|jj
��}|jjj|�}y|j
�}Wntk
r�tSX|jdks�d|kr�|ddkr�tStS(Ns!The specified pool does not exists0https://{0}:{1}/mgmt/tm/ltm/pool/{2}/members/{3}tservertserver_portR6i�tcode(R�RR:R�tproviderRRRJRKRIR>tapiR�tjsont
ValueErrorR{RRz(R<turitresptresponse((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s

!
+cC`s�|jr8tdt|jjd|jjd��}n$tdt|jj|jj��}dj|j	j
d|j	j
d|�}|j	jj|�}y|j
�}Wntk
r�tSX|jdks�d|kr�|ddkr�tStS(	NR6RKRIs$https://{0}:{1}/mgmt/tm/ltm/pool/{2}R�R�i�R�(R�RRR�R�RJRKRIR:R�R�R�R�R�R�R{RRz(R<t	pool_nameR�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.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/node/{2}R�R�i�R�(R:R�R�RRJRKRBR�R�R�R�R{RRz(R<R�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�s


+cC`s�t|jj�r9|jjidd6|jjd6�nEt|jj�sZtd��n|jji|jjd6dd6�dS(NR*R)s2'name' is neither a valid IP address or FQDN name.(RRJR6R�R@RR(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�s
cC`s�|jjdkr3|jjidd6dd6�nf|jjdkrf|jjidd6dd6�n3|jjdkr�|jjidd6d
d6�ndS(NRts	user-downR,s
user-disabledR+RFsuser-upRPRDsuser-enabled(spresentsenabled(RJR,R�(R<((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�+scC`s�y�|j|jj�}|jjrC|jjrC|jjd�n|jji|jddkrht	nt
d6�d|jkr�|jji|jdd6dd6�n|jji|jd6�Wntk
r�dSXdS(	NsW'fqdn_auto_populate' is discarded in favor of the re-used node's auto-populate setting.RERDR-RGR*RMR)(tread_current_node_from_deviceRJRBR-R�R�twarnR�R*RzR{R)RTR@(R<R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�<s$
c	C`sdj|jjd|jjdtdt|jjd|jjd���}d}|jjj||�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|dd	kr�d
|kr�t|d
��q�t|j
��nd|kr|dSgS(Ns,https://{0}:{1}/mgmt/tm/ltm/pool/{2}/membersR�R�R6RKRIs-?$select=name,selfLink,fqdn,address,ephemeralR�i�tmessageR�(R:R�R�RRR�R�R�R�R�R�RRntcontent(R<R�tqueryR�R�tex((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�Qs"

/cC`s|jj�}|jj|d<|jj|d<dj|jjd|jjdtdt	|jj|jj
���}|jjj|d|�}y|j
�}Wn%tk
r�}tt|���nXd|kr|ddkrd
|krt|d
��qt|j��ndS(NR6RKs,https://{0}:{1}/mgmt/tm/ltm/pool/{2}/membersR�R�R�R�i�i�R�(i�i�(R�t
api_paramsRJR>RKR:R�R�RRRIR�tpostR�R�RRnR�(R<R�R�R�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�is 

'cC`s|jj�}dj|jjd|jjdtdt|jj|jj	��t|jj|jj
��}|jjj|d|�}y|j
�}Wn%tk
r�}tt|���nXd|kr|ddkrd|kr�t|d��qt|j��ndS(	Ns0https://{0}:{1}/mgmt/tm/ltm/pool/{2}/members/{3}R�R�R6R�R�i�R�(R�RR:R�R�RRRJRKRIR>R�tpatchR�R�RRnR�(R<R�R�R�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�s

!cC`s�dj|jjd|jjdtdt|jj|jj��t|jj|jj��}|jj	j
|�}|jdkr�tSt
|j��dS(Ns0https://{0}:{1}/mgmt/tm/ltm/pool/{2}/members/{3}R�R�R6i�(R:R�R�RRRJRKRIR>R�tdeleteRRzRR�(R<R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s

!cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns$https://{0}:{1}/mgmt/tm/ltm/node/{2}R�R�i�(
R:R�R�RRJRKRBR�RRRzRR�(R<R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s

cC`s2dj|jjd|jjdtdt|jj|jj��t|jj|jj��}|jj	j
|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��n|jd�}|jd	�}|||d
<td|�S(Ns0https://{0}:{1}/mgmt/tm/ltm/pool/{2}/members/{3}R�R�R6R�i�R�R�R�R�R�(R:R�R�RRRJRKRIR>R�R�R�R�RRnR�R�Re(R<R�R�R�R�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s$

!cC`s�dj|jjd|jjdt|jj|��}|jjj|�}y|j�}Wn%t	k
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��nt
d|�S(Ns$https://{0}:{1}/mgmt/tm/ltm/node/{2}R�R�R�i�R�R�(R:R�R�RRJRKR�R�R�R�RRnR�R|(R<tnodeR�R�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s

cC`s�dj|jjd|jjd|�}|jjj|�}y|j�}Wn%tk
ru}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��nd|kr�gSg|dD]}|d^q�S(	Ns'https://{0}:{1}/mgmt/tm/net/tunnels/{2}R�R�R�i�R�R�tfullPath(
R:R�R�R�R�R�R�RRnR�(R<ttunnel_typeR�R�R�R�R_((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s 

	cC`s�tt|��}t�}g|D]}t|�j^q"}xD|D]<}dj|jjd|jjd|�}|j|�qDW|S(Nshttps://{0}:{1}{2}R�R�(RlRmR	R�R:R�R�R�(R<R�tno_dupestlinkstlinktpurge_pathsR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.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�(RR�RR�R�RR�R�RRnR�Rz(R<RttransactR	R�R�R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��s
N(%R.R/R�R�R�R�R�R�R�R�R�R�R@R�RPR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RR�(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR��sD	
								
							
												
					tArgumentSpeccB`seZd�ZRS(c(C`s}t|_tdtdddg�dtddg�dt�dtd	d
�dtd	d
�dt�d
td	d
�dtd	d
�dtd	d�dtd	d
�dtddddddddg�dtd	d�dtd	ddt�dtd	ddtd	tddd gd!t�d td	d
��d"d	d d ggg�d#td	d$�d%t�d&tdd'd(td)gf��}t|�}t|�td*td	d$d+dd|dd,gd-ddggd.ddgg�d/td	ddd0gdd1�d2td!t�d&tdd'd(td)gf��|_|jj|�|jjt�dd*gdd*gg|_	ddd*gg|_
dS(3NR)taliasesthosttipR*thostnameR6R;RaRLRR'RR(R�tboolRR,RWRPtchoicesR�RDRFRtR-R�R`RAtoptionsRkRYtrequiredtrequired_ifR!RlR%RKtCommontfallbacktF5_PARTITIONR�telementstmemberstmutually_exclusivetrequired_one_ofR�R�RgRI(Rztsupports_check_modeRARRR
t
argument_specR�RRR(R<telement_spectaggregate_spec((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR�sl					
				(R.R/R�(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyR
sc	C`s�t�}td|jd|jd|jd|j�}y,td|�}|j�}|j|�Wn)t	k
r�}|j
dt|��nXdS(NRRRRR�R�(R
R
RRRRR�R�t	exit_jsonRt	fail_jsonRn(tspecR�tmmtresultsR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pytmaings				t__main__(;t
__future__RRRRat
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR�RQtcopyRtansible.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.commonRRRRRRRt'library.module_utils.network.f5.compareRt)library.module_utils.network.f5.ipaddressRRt(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.ipaddresst(ansible.module_utils.network.f5.icontrolRR4ReR|R}R�R�tobjectR�R�R
R'R.(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_pool_member.pyt<module>sp


��5
;��
T^��T	

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