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_virtual_server.pyo

�
�Udac@`s!ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZddlmZy4ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl"m#Z#ddl"m$Z$ddl"m%Z%ddl"m&Z&dd l"m'Z'dd!l"m(Z(dd"l)m*Z*WnAe+k
r!ddl,mZddl-mZddl-mZddl-mZddl-mZddl-mZddl-mZddl-mZddl-mZddl-mZddl-mZddl.m!Z!ddl/m#Z#ddl/m$Z$ddl/m%Z%ddl/m&Z&dd l/m'Z'dd!l/m(Z(dd"l0m*Z*nXd#efd$��YZ1d%e1fd&��YZ2d'e1fd(��YZ3d)e1fd*��YZ4d+e4fd,��YZ5d-e4fd.��YZ6d/e7fd0��YZ8d1e7fd2��YZ9d3e7fd4��YZ:d5e7fd6��YZ;d7�Z<e=d8kre<�ndS(9i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bysyW
---
module: bigip_virtual_server
short_description: Manage LTM virtual servers on a BIG-IP
description:
  - Manage LTM virtual servers on a BIG-IP.
version_added: 2.1
options:
  state:
    description:
      - The virtual server state. If C(absent), delete the virtual server
        if it exists. C(present) creates the virtual server and enable it.
        If C(enabled), enable the virtual server if it exists. If C(disabled),
        create the virtual server if needed, and set state to C(disabled).
    type: str
    choices:
      - present
      - absent
      - enabled
      - disabled
    default: present
  type:
    description:
      - Specifies the network service provided by this virtual server.
      - When creating a new virtual server, if this parameter is not provided, the
        default will be C(standard).
      - This value cannot be changed after it is set.
      - When C(standard), specifies a virtual server that directs client traffic to
        a load balancing pool and is the most basic type of virtual server. When you
        first create the virtual server, you assign an existing default pool to it.
        From then on, the virtual server automatically directs traffic to that default pool.
      - When C(forwarding-l2), specifies a virtual server that shares the same IP address as a
        node in an associated VLAN.
      - When C(forwarding-ip), specifies a virtual server like other virtual servers, except
        that the virtual server has no pool members to load balance. The virtual server simply
        forwards the packet directly to the destination IP address specified in the client request.
      - When C(performance-http), specifies a virtual server with which you associate a Fast HTTP
        profile. Together, the virtual server and profile increase the speed at which the virtual
        server processes HTTP requests.
      - When C(performance-l4), specifies a virtual server with which you associate a Fast L4 profile.
        Together, the virtual server and profile increase the speed at which the virtual server
        processes layer 4 requests.
      - When C(stateless), specifies a virtual server that accepts traffic matching the virtual
        server address and load balances the packet to the pool members without attempting to
        match the packet to a pre-existing connection in the connection table. New connections
        are immediately removed from the connection table. This addresses the requirement for
        one-way UDP traffic that needs to be processed at very high throughput levels, for example,
        load balancing syslog traffic to a pool of syslog servers. Stateless virtual servers are
        not suitable for processing traffic that requires stateful tracking, such as TCP traffic.
        Stateless virtual servers do not support iRules, persistence, connection mirroring,
        rateshaping, or SNAT automap.
      - When C(reject), specifies that the BIG-IP system rejects any traffic destined for the
        virtual server IP address.
      - When C(dhcp), specifies a virtual server that relays Dynamic Host Control Protocol (DHCP)
        client requests for an IP address to one or more DHCP servers, and provides DHCP server
        responses with an available IP address for the client.
      - When C(internal), specifies a virtual server that supports modification of HTTP requests
        and responses. Internal virtual servers enable usage of ICAP (Internet Content Adaptation
        Protocol) servers to modify HTTP requests and responses by creating and applying an ICAP
        profile and adding Request Adapt or Response Adapt profiles to the virtual server.
      - When C(message-routing), specifies a virtual server that uses a SIP application protocol
        and functions in accordance with a SIP session profile and SIP router profile.
    type: str
    choices:
      - standard
      - forwarding-l2
      - forwarding-ip
      - performance-http
      - performance-l4
      - stateless
      - reject
      - dhcp
      - internal
      - message-routing
    default: standard
    version_added: 2.6
  name:
    description:
      - Virtual server name.
    type: str
    required: True
    aliases:
      - vs
  destination:
    description:
      - Destination IP of the virtual server.
      - Required when C(state) is C(present) and virtual server does not exist.
      - When C(type) is C(internal), this parameter is ignored. For all other types,
        it is required.
      - Destination can also be specified as a name for an existing Virtual Address.
    type: str
    aliases:
      - address
      - ip
  source:
    description:
      - Specifies an IP address or network from which the virtual server accepts traffic.
      - The virtual server accepts clients only from one of these IP addresses.
      - For this setting to function effectively, specify a value other than 0.0.0.0/0 or ::/0
        (that is, any/0, any6/0).
      - In order to maximize utility of this setting, specify the most specific address
        prefixes covering all customer addresses and no others.
      - Specify the IP address in Classless Inter-Domain Routing (CIDR) format; address/prefix,
        where the prefix length is in bits. For example, for IPv4, 10.0.0.1/32 or 10.0.0.0/24,
        and for IPv6, ffe1::0020/64 or 2001:ed8:77b5:2:10:10:100:42/64.
    type: str
    version_added: 2.5
  port:
    description:
      - Port of the virtual server. Required when C(state) is C(present)
        and virtual server does not exist.
      - If you do not want to specify a particular port, use the value C(0).
        The result is that the virtual server will listen on any port.
      - When C(type) is C(dhcp), this module will force the C(port) parameter to be C(67).
      - When C(type) is C(internal), this module will force the C(port) parameter to be C(0).
      - In addition to specifying a port number, a select number of service names may also
        be provided.
      - The string C(ftp) may be substituted for for port C(21).
      - The string C(http) may be substituted for for port C(80).
      - The string C(https) may be substituted for for port C(443).
      - The string C(telnet) may be substituted for for port C(23).
      - The string C(smtp) may be substituted for for port C(25).
      - The string C(snmp) may be substituted for for port C(161).
      - The string C(snmp-trap) may be substituted for for port C(162).
      - The string C(ssh) may be substituted for for port C(22).
      - The string C(tftp) may be substituted for for port C(69).
      - The string C(isakmp) may be substituted for for port C(500).
      - The string C(mqtt) may be substituted for for port C(1883).
      - The string C(mqtt-tls) may be substituted for for port C(8883).
    type: str
  profiles:
    description:
      - List of profiles (HTTP, ClientSSL, ServerSSL, etc) to apply to both sides
        of the connection (client-side and server-side).
      - If you only want to apply a particular profile to the client-side of
        the connection, specify C(client-side) for the profile's C(context).
      - If you only want to apply a particular profile to the server-side of
        the connection, specify C(server-side) for the profile's C(context).
      - If C(context) is not provided, it will default to C(all).
      - If you want to remove a profile from the list of profiles currently active
        on the virtual, then simply remove it from the C(profiles) list. See
        examples for an illustration of this.
      - If you want to add a profile to the list of profiles currently active
        on the virtual, then simply add it to the C(profiles) list. See
        examples for an illustration of this.
      - B(Profiles matter). This module will fail to configure a BIG-IP if you mix up
        your profiles, or, if you attempt to set an IP protocol which your current,
        or new, profiles do not support. Both this module, and BIG-IP, will tell you
        when you are wrong, with an error resembling C(lists profiles incompatible
        with its protocol).
      - If you are unsure what correct profile combinations are, then have a BIG-IP
        available to you in which you can make changes and copy what the correct
        combinations are.
    suboptions:
      name:
        description:
          - Name of the profile.
          - If this is not specified, then it is assumed that the profile item is
            only a name of a profile.
          - This must be specified if a context is specified.
        type: str
      context:
        description:
          - The side of the connection on which the profile should be applied.
        type: str
        choices:
          - all
          - server-side
          - client-side
        default: all
    type: list
    aliases:
      - all_profiles
  irules:
    version_added: 2.2
    description:
      - List of rules to be applied in priority order.
      - If you want to remove existing iRules, specify a single empty value; C("").
        See the documentation for an example.
      - When C(type) is C(dhcp), this parameter will be ignored.
      - When C(type) is C(stateless), this parameter will be ignored.
      - When C(type) is C(reject), this parameter will be ignored.
      - When C(type) is C(internal), this parameter will be ignored.
    type: list
    aliases:
      - all_rules
  enabled_vlans:
    description:
      - List of VLANs to be enabled. When a VLAN named C(all) is used, all
        VLANs will be allowed. VLANs can be specified with or without the
        leading partition. If the partition is not specified in the VLAN,
        then the C(partition) option of this module will be used.
      - This parameter is mutually exclusive with the C(disabled_vlans) parameter.
    type: list
    version_added: 2.2
  disabled_vlans:
    description:
      - List of VLANs to be disabled. If the partition is not specified in the VLAN,
        then the C(partition) option of this module will be used.
      - This parameter is mutually exclusive with the C(enabled_vlans) parameters.
    type: list
    version_added: 2.5
  pool:
    description:
      - Default pool for the virtual server.
      - If you want to remove the existing pool, specify an empty value; C("").
        See the documentation for an example.
      - When creating a new virtual server, and C(type) is C(stateless), this parameter
        is required.
      - If C(type) is C(stateless), the C(pool) that is used must not have any members
        which define a C(rate_limit).
    type: str
  policies:
    description:
      - Specifies the policies for the virtual server.
      - When C(type) is C(dhcp), this parameter will be ignored.
      - When C(type) is C(reject), this parameter will be ignored.
      - When C(type) is C(internal), this parameter will be ignored.
    type: list
    aliases:
      - all_policies
  snat:
    description:
      - Source network address policy.
      - When C(type) is C(dhcp), this parameter is ignored.
      - When C(type) is C(reject), this parameter will be ignored.
      - When C(type) is C(internal), this parameter will be ignored.
      - The name of a SNAT pool (eg "/Common/snat_pool_name") can be specified to enable SNAT
        with the specific pool.
      - To remove SNAT, specify the word C(none).
      - To specify automap, use the word C(automap).
    type: str
  default_persistence_profile:
    description:
      - Default Profile which manages the session persistence.
      - If you want to remove the existing default persistence profile, specify an
        empty value; C(""). See the documentation for an example.
      - When C(type) is C(dhcp), this parameter will be ignored.
    type: str
  description:
    description:
      - Virtual server description.
    type: str
  fallback_persistence_profile:
    description:
      - Specifies the persistence profile you want the system to use if it
        cannot use the specified default persistence profile.
      - If you want to remove the existing fallback persistence profile, specify an
        empty value; C(""). See the documentation for an example.
      - When C(type) is C(dhcp), this parameter will be ignored.
    type: str
    version_added: 2.3
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
    version_added: 2.5
  metadata:
    description:
      - Arbitrary key/value pairs that you can attach to a virtual server. This is useful in
        situations where you might want to annotate a virtual to be 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
  insert_metadata:
    description:
      - When set to C(no) it will not set metadata on the device.
      - Currently there is a limitation that non-admin users cannot set metadata on the object, despite being
        able to create and modify virtual server objects, setting this option to C(no) will allow
        such users to utilize this module to manage Virtual Server objects on the device.
    type: bool
    default: yes
    version_added: 2.8
  address_translation:
    description:
      - Specifies, when C(enabled), that the system translates the address of the
        virtual server.
      - When C(disabled), specifies that the system uses the address without translation.
      - This option is useful when the system is load balancing devices that have the
        same IP address.
      - When creating a new virtual server, the default is C(enabled).
    type: bool
    version_added: 2.6
  port_translation:
    description:
      - Specifies, when C(enabled), that the system translates the port of the virtual
        server.
      - When C(disabled), specifies that the system uses the port without translation.
        Turning off port translation for a virtual server is useful if you want to use
        the virtual server to load balance connections to any service.
      - When creating a new virtual server, the default is C(enabled).
    type: bool
    version_added: 2.6
  source_port:
    description:
      - Specifies whether the system preserves the source port of the connection.
      - When creating a new virtual server, if this parameter is not specified, the default is C(preserve).
    type: str
    choices:
      - preserve
      - preserve-strict
      - change
    version_added: 2.8
  mirror:
    description:
      - Specifies that the system mirrors connections on each member of a redundant pair.
      - When creating a new virtual server, if this parameter is not specified, the default is C(disabled).
    type: bool
    version_added: 2.8
  mask:
   description:
      - Specifies the destination address network mask. This parameter will work with IPv4 and IPv6 type of addresses.
      - This is an optional parameter which can be specified when creating or updating virtual server.
      - If C(destination) is set in CIDR notation format and C(mask) is provided the C(mask) parameter takes precedence.
      - If catchall destination is specified, i.e. C(0.0.0.0) for IPv4 C(::) for IPv6,
        mask parameter is set to C(any) or C(any6) respectively.
      - When the C(destination) is provided not in CIDR notation and C(mask) is not specified, C(255.255.255.255) or
        C(ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff) is set for IPv4 and IPv6 addresses respectively.
      - When C(destination) is provided in CIDR notation format and C(mask) is not specified the mask parameter is
        inferred from C(destination).
      - When C(destination) is provided as Virtual Address name, and C(mask) is not specified,
        the mask will be C(None) allowing device set it with its internal defaults.
   type: str
   version_added: 2.8
  ip_protocol:
    description:
      - Specifies a network protocol name you want the system to use to direct traffic
        on this virtual server.
      - When creating a new virtual server, if this parameter is not specified, the default is C(tcp).
      - The Protocol setting is not available when you select Performance (HTTP) as the Type.
      - The value of this argument can be specified in either it's numeric value, or,
        for convenience, in a select number of named values. Refer to C(choices) for examples.
      - For a list of valid IP protocol numbers, refer to this page
        https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
      - When C(type) is C(dhcp), this module will force the C(ip_protocol) parameter to be C(17) (UDP).
    type: str
    choices:
      - ah
      - any
      - bna
      - esp
      - etherip
      - gre
      - icmp
      - ipencap
      - ipv6
      - ipv6-auth
      - ipv6-crypt
      - ipv6-icmp
      - isp-ip
      - mux
      - ospf
      - sctp
      - tcp
      - udp
      - udplite
    version_added: 2.6
  firewall_enforced_policy:
    description:
      - Applies the specify AFM policy to the virtual in an enforcing way.
      - When creating a new virtual, if this parameter is not specified, the enforced
        policy is disabled.
    type: str
    version_added: 2.6
  firewall_staged_policy:
    description:
      - Applies the specify AFM policy to the virtual in an enforcing way.
      - A staged policy shows the results of the policy rules in the log, while not
        actually applying the rules to traffic.
      - When creating a new virtual, if this parameter is not specified, the staged
        policy is disabled.
    type: str
    version_added: 2.6
  security_log_profiles:
    description:
      - Specifies the log profile applied to the virtual server.
      - To make use of this feature, the AFM module must be licensed and provisioned.
      - The C(Log all requests) and C(Log illegal requests) are mutually exclusive and
        therefore, this module will raise an error if the two are specified together.
    type: list
    version_added: 2.6
  security_nat_policy:
    description:
      - Specify the Firewall NAT policies for the virtual server.
      - You can specify one or more NAT policies to use.
      - The most specific policy is used. For example, if you specify that the
        virtual server use the device policy and the route domain policy, the route
        domain policy overrides the device policy.
    version_added: 2.7
    suboptions:
      policy:
        description:
          - Policy to apply a NAT policy directly to the virtual server.
          - The virtual server NAT policy is the most specific, and overrides a
            route domain and device policy, if specified.
          - To remove the policy, specify an empty string value.
        type: str
      use_device_policy:
        description:
          - Specify that the virtual server uses the device NAT policy, as specified
            in the Firewall Options.
          - The device policy is used if no route domain or virtual server NAT
            setting is specified.
        type: bool
      use_route_domain_policy:
        description:
          - Specify that the virtual server uses the route domain policy, as
            specified in the Route Domain Security settings.
          - When specified, the route domain policy overrides the device policy, and
            is overridden by a virtual server policy.
        type: bool
    type: dict
  ip_intelligence_policy:
    description:
      - Specifies the IP intelligence policy applied to the virtual server.
      - This parameter requires that a valid BIG-IP security module such as ASM or AFM
        be provisioned.
    type: str
    version_added: 2.8
  rate_limit:
    description:
      - Virtual server rate limit (connections-per-second). Setting this to 0
        disables the limit.
      - The valid value range is C(0) - C(4294967295).
    type: int
    version_added: 2.8
  rate_limit_dst_mask:
    description:
      - Specifies a mask, in bits, to be applied to the destination address as part of the rate limiting.
      - The default value is C(0), which is equivalent to using the entire address - C(32) in IPv4, or C(128) in IPv6.
      - The valid value range is C(0) - C(4294967295).
    type: int
    version_added: 2.8
  rate_limit_src_mask:
    description:
      - Specifies a mask, in bits, to be applied to the source address as part of the rate limiting.
      - The default value is C(0), which is equivalent to using the entire address - C(32) in IPv4, or C(128) in IPv6.
      - The valid value range is C(0) - C(4294967295).
    type: int
    version_added: 2.8
  rate_limit_mode:
    description:
      - Indicates whether the rate limit is applied per virtual object, per source address, per destination address,
        or some combination thereof.
      - The default value is 'object', which does not use the source or destination address as part of the key.
    type: str
    choices:
      - object
      - object-source
      - object-destination
      - object-source-destination
      - destination
      - source
      - source-destination
    default: object
    version_added: 2.8
  clone_pools:
    description:
      - Specifies a pool or list of pools that the virtual server uses to replicate either client-side
        or server-side traffic.
      - Typically this option is used for intrusion detection.
    suboptions:
      pool_name:
        description:
          - The pool name to which the server replicates the traffic.
          - Only pools created on Common partition or on the same partition as the virtual server can be used.
          - Referencing pool on common partition needs to be done in the full path format,
            for example, C(/Common/pool_name).
        type: str
        required: True
      context:
        description:
          - The context option for a clone pool to replicate either client-side or server-side traffic.
        type: str
        choices:
         - clientside
         - serverside
    type: list
    version_added: 2.8
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Modify Port of the Virtual Server
  bigip_virtual_server:
    state: present
    partition: Common
    name: my-virtual-server
    port: 8080
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Delete virtual server
  bigip_virtual_server:
    state: absent
    partition: Common
    name: my-virtual-server
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Add virtual server
  bigip_virtual_server:
    state: present
    partition: Common
    name: my-virtual-server
    destination: 10.10.10.10
    port: 443
    pool: my-pool
    snat: Automap
    description: Test Virtual Server
    profiles:
      - http
      - fix
      - name: clientssl
        context: server-side
      - name: ilx
        context: client-side
    policies:
      - my-ltm-policy-for-asm
      - ltm-uri-policy
      - ltm-policy-2
      - ltm-policy-3
    enabled_vlans:
      - /Common/vlan2
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Add FastL4 virtual server
  bigip_virtual_server:
    destination: 1.1.1.1
    name: fastl4_vs
    port: 80
    profiles:
      - fastL4
    state: present
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Add iRules to the Virtual Server
  bigip_virtual_server:
    name: my-virtual-server
    irules:
      - irule1
      - irule2
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Remove one iRule from the Virtual Server
  bigip_virtual_server:
    name: my-virtual-server
    irules:
      - irule2
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Remove all iRules from the Virtual Server
  bigip_virtual_server:
    name: my-virtual-server
    irules: ""
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Remove pool from the Virtual Server
  bigip_virtual_server:
    name: my-virtual-server
    pool: ""
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Add metadata to virtual
  bigip_pool:
    state: absent
    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 virtual with two profiles
  bigip_pool:
    state: absent
    name: my-pool
    partition: Common
    profiles:
      - http
      - tcp
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Remove HTTP profile from previous virtual
  bigip_pool:
    state: absent
    name: my-pool
    partition: Common
    profiles:
      - tcp
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add the HTTP profile back to the previous virtual
  bigip_pool:
    state: absent
    name: my-pool
    partition: Common
    profiles:
      - http
      - tcp
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add virtual server with rate limit
  bigip_virtual_server:
    state: present
    partition: Common
    name: my-virtual-server
    destination: 10.10.10.10
    port: 443
    pool: my-pool
    snat: Automap
    description: Test Virtual Server
    profiles:
      - http
      - fix
      - name: clientssl
        context: server-side
      - name: ilx
        context: client-side
    policies:
      - my-ltm-policy-for-asm
      - ltm-uri-policy
      - ltm-policy-2
      - ltm-policy-3
    enabled_vlans:
      - /Common/vlan2
    rate_limit: 400
    rate_limit_mode: destination
    rate_limit_dst_mask: 32
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost

- name: Add FastL4 virtual server with clone_pools
  bigip_virtual_server:
    destination: 1.1.1.1
    name: fastl4_vs
    port: 80
    profiles:
      - fastL4
    state: present
    clone_pools:
      - pool_name: FooPool
        context: clientside
    provider:
      server: lb.mydomain.net
      user: admin
      password: secret
  delegate_to: localhost
s

description:
  description: New description of the virtual server.
  returned: changed
  type: str
  sample: This is my description
default_persistence_profile:
  description: Default persistence profile set on the virtual server.
  returned: changed
  type: str
  sample: /Common/dest_addr
destination:
  description: Destination of the virtual server.
  returned: changed
  type: str
  sample: 1.1.1.1
disabled:
  description: Whether the virtual server is disabled, or not.
  returned: changed
  type: bool
  sample: True
disabled_vlans:
  description: List of VLANs that the virtual is disabled for.
  returned: changed
  type: list
  sample: ['/Common/vlan1', '/Common/vlan2']
enabled:
  description: Whether the virtual server is enabled, or not.
  returned: changed
  type: bool
  sample: False
enabled_vlans:
  description: List of VLANs that the virtual is enabled for.
  returned: changed
  type: list
  sample: ['/Common/vlan5', '/Common/vlan6']
fallback_persistence_profile:
  description: Fallback persistence profile set on the virtual server.
  returned: changed
  type: str
  sample: /Common/source_addr
irules:
  description: iRules set on the virtual server.
  returned: changed
  type: list
  sample: ['/Common/irule1', '/Common/irule2']
pool:
  description: Pool that the virtual server is attached to.
  returned: changed
  type: str
  sample: /Common/my-pool
policies:
  description: List of policies attached to the virtual.
  returned: changed
  type: list
  sample: ['/Common/policy1', '/Common/policy2']
port:
  description: Port that the virtual server is configured to listen on.
  returned: changed
  type: int
  sample: 80
profiles:
  description: List of profiles set on the virtual server.
  returned: changed
  type: list
  sample: [{'name': 'tcp', 'context': 'server-side'}, {'name': 'tcp-legacy', 'context': 'client-side'}]
snat:
  description: SNAT setting of the virtual server.
  returned: changed
  type: str
  sample: Automap
source:
  description: Source address, in CIDR form, set on the virtual server.
  returned: changed
  type: str
  sample: 1.2.3.4/32
metadata:
  description: The new value of the virtual.
  returned: changed
  type: dict
  sample: {'key1': 'foo', 'key2': 'bar'}
address_translation:
  description: The new value specifying whether address translation is on or off.
  returned: changed
  type: bool
  sample: True
port_translation:
  description: The new value specifying whether port translation is on or off.
  returned: changed
  type: bool
  sample: True
source_port:
  description: Specifies whether the system preserves the source port of the connection.
  returned: changed
  type: str
  sample: change
mirror:
  description: Specifies that the system mirrors connections on each member of a redundant pair.
  returned: changed
  type: bool
  sample: True
ip_protocol:
  description: The new value of the IP protocol.
  returned: changed
  type: int
  sample: 6
firewall_enforced_policy:
  description: The new enforcing firewall policy.
  returned: changed
  type: str
  sample: /Common/my-enforced-fw
firewall_staged_policy:
  description: The new staging firewall policy.
  returned: changed
  type: str
  sample: /Common/my-staged-fw
security_log_profiles:
  description: The new list of security log profiles.
  returned: changed
  type: list
  sample: ['/Common/profile1', '/Common/profile2']
ip_intelligence_policy:
  description: The new IP Intelligence Policy assigned to the virtual.
  returned: changed
  type: str
  sample: /Common/ip-intelligence
rate_limit:
  description: The maximum number of connections per second allowed for a virtual server.
  returned: changed
  type: int
  sample: 5000
rate_limit_src_mask:
  description: Specifies a mask, in bits, to be applied to the source address as part of the rate limiting.
  returned: changed
  type: int
  sample: 32
rate_limit_dst_mask:
  description: Specifies a mask, in bits, to be applied to the destination address as part of the rate limiting.
  returned: changed
  type: int
  sample: 32
rate_limit_mode:
  description: Sets the type of rate limiting to be used on the virtual server.
  returned: changed
  type: str
  sample: object-source
clone_pools:
  description: Pools to which virtual server copies traffic.
  returned: changed
  type: list
  sample: [{'pool_name':'/Common/Pool1', 'context': 'clientside'}]
N(t
AnsibleModule(tenv_fallback(t	iteritems(t
namedtuple(tF5RestClient(tMANAGED_BY_ANNOTATION_VERSION(tMANAGED_BY_ANNOTATION_MODIFIED(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tmark_managed_by(tonly_has_managed_metadata(tflatten_boolean(tcmp_simple_list(tis_valid_ip(tis_valid_ip_interface(tip_interface(tvalidate_ip_v6_address(tget_netmask(tcompress_address(tmodules_provisionedt
Parametersc&B`seZidd6dd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6Zd,d-d.d/ddd0ddd1d
dd2dd3dd	ddd4d5d6d7d8d9dddddd:d;d!d#d%d'd)d+g&Zdd,dd-d<d/d=dddd0d1dd>dd
dd2d?dddddd:d;d d"d$d(d&d*g Zdd,dd-d.d<d/d=dddd0d1dd>dd
dd2d3ddd?dddddd:d;d d"d$d(d&d*g$Zd@dAdBdCdDdEdFdGdHdIdJdKdLg
Zd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�gZdo�Zdp�Z	dq�Z
edr��Zeds��Z
edt��Zedu��Zdv�Zdw�Zdx�Zdy�Zdz�Zd{�Zd|�Zd}�Zd~�Zd�ZRS(�tsnattsourceAddressTranslationtfallback_persistence_profiletfallbackPersistencetdefault_persistence_profiletpersistt
vlans_enabledtvlansEnabledtvlans_disabledt
vlansDisabledtprofilestprofilesReferencetpoliciestpoliciesReferencetirulestrulestaddress_translationttranslateAddresstport_translationt
translatePorttip_protocolt
ipProtocoltfirewall_enforced_policytfwEnforcedPolicytfirewall_staged_policytfwStagedPolicytsecurity_log_profilestsecurityLogProfilestsecurity_nat_policytsecurityNatPolicytsource_portt
sourcePorttip_intelligence_policytipIntelligencePolicyt
rate_limitt	rateLimittrate_limit_modet
rateLimitModetrate_limit_dst_masktrateLimitDstMasktrate_limit_src_masktrateLimitSrcMasktclone_poolst
clonePoolstdescriptiontdestinationtdisabledtenabledtmetadatatpooltsourcetvlanst	l2Forwardt	ipForwardt	statelesstrejectt	dhcpRelaytinternaltmirrortmasktdisabled_vlanst
enabled_vlanstportttypetsipt
sipsessiontiioptrtspthttptdiametertdiametersessiontradiustftpttftptdnstpptptfixtahi3tbnai1tespi2tetheripiatgrei/ticmpitipencapitipv6i)s	ipv6-auths
ipv6-crypts	ipv6-icmpi:siso-ipiPtmuxitospfiYtsctpi�ttcpitudpitudplitei�cC`sXi}x<|jD]1}yt||�||<Wqtk
r@qXqW|j|�}|S(N(treturnablestgetattrt	Exceptiont_filter_params(tselftresultt
returnable((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt	to_returnMs
cC`s1t|�rdj|�}ndj|�}|S(Ns.{0}s:{0}(Rtformat(RtipR^R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_format_port_for_destinationWscC`s�|dkrW|dkr6djt|j|��}q�djt|j|�|�}n`|j||�}|dkr�djt|j|�|�}n!djt|j|�||�}|S(Ns{0}s{0}%{1}s{0}{1}s
{0}%{1}{2}(tNoneR�Rt	partitionR�(RtaddressR^troute_domainR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_format_destination^s"	cC`s�|jddkrdS|jddkr.dSx6|jD]+}|d|jdkr8t|d�Sq8Wyt|jd�SWntk
r�td��nXdS(NR4tanyiisOSpecified ip_protocol was neither a number nor in the list of common protocols.(t_valuesR�tip_protocols_maptintt
ValueErrorR(Rtx((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR4xs
cC`si|jdkrdS|j�}g|jD] }|d|kr)|d^q)}t|�dkretStS(Ntnamei(R*R�t2_read_current_message_routing_profiles_from_devicetlentTruetFalse(RtcurrentR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pythas_message_routing_profiles�s0cC`si|jdkrdS|j�}g|jD] }|d|kr)|d^q)}t|�dkretStS(NR�i(R*R�t)_read_current_fastl4_profiles_from_deviceR�R�R�(RR�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pythas_fastl4_profiles�s0cC`si|jdkrdS|j�}g|jD] }|d|kr)|d^q)}t|�dkretStS(sCheck if ``fasthttp`` profile is in API profiles

        This method is used to determine the server type when doing comparisons
        in the Difference class.

        Returns:
             bool: True if server has ``fasthttp`` profiles. False otherwise.
        R�iN(R*R�t+_read_current_fasthttp_profiles_from_deviceR�R�R�(RR�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pythas_fasthttp_profiles�s
0cC`s*g}||j�7}||j�7}|S(N(t#_read_diameter_profiles_from_devicet_read_sip_profiles_from_device(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR��scC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}|d^q�}|S(	Ns-https://{0}:{1}/mgmt/tm/ltm/profile/diameter/tservertserver_porttcodei�tmessagetitemsR�(
R�tclienttprovidertapitgettjsonR�Rtstrtcontent(RturitresptresponsetexR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR��s
!cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}|d^q�}|S(	Ns(https://{0}:{1}/mgmt/tm/ltm/profile/sip/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR��s
!cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}|d^q�}|S(	Ns+https://{0}:{1}/mgmt/tm/ltm/profile/fastl4/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR��s
!cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}|d^q�}|S(	Ns-https://{0}:{1}/mgmt/tm/ltm/profile/fasthttp/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR��s
!cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}|d^q�}|S(	Ns/https://{0}:{1}/mgmt/tm/ltm/profile/client-ssl/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt,_read_current_clientssl_profiles_from_devices
!cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}|d^q�}|S(	Ns/https://{0}:{1}/mgmt/tm/ltm/profile/server-ssl/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt,_read_current_serverssl_profiles_from_devices
!cC`s|d|j�krtStS(NR�(R�R�R�(Rtprofile((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_is_client_ssl_profile&scC`s|d|j�krtStS(NR�(R�R�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_is_server_ssl_profile+scC`s�tdt|j|��}dj|jjd|jjd|�}|jjj|�}y|j�}Wnt	k
r}t
SX|jdks�d|kr�|ddkr�tdj|���n|S(NR�s$https://{0}:{1}/mgmt/tm/ltm/pool/{2}R�R�i�R�s&The specified pool {0} does not exist.(
RRR�R�R�R�R�R�R�R�R�RR(RtitemRQR�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_check_pool0s

	
+(Rmi3(Rni1(Roi2(Rpia(Rqi/(Rri(Rsi(Rti)(s	ipv6-authi3(s
ipv6-crypti2(s	ipv6-icmpi:(siso-ipiP(Rui(RviY(Rwi�(Rxi(Ryi(Rzi�(t__name__t
__module__tapi_maptapi_attributest
updatablesR{tprofiles_mutexR�R�R�R�tpropertyR4R�R�R�R�R�R�R�R�R�R�R�R�R�(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�sb
						
		

									t
ApiParameterscB`s%eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed	��Zed
��Z
ed��Zed��Zed
��Zed��Zed��Zed��Zed��Zed��ZRS(cC`s�|jdr|jdS|jtkr0d}n�|jtkrHd}n�|jtkr`d}n�|jtkrxd}nl|jtkr�d}nT|jtkr�d}n<|jr�d}n*|j	r�d	}n|j
r�d
}nd}||jd<|S(s&Attempt to determine the current server type

        This check is very unscientific. It turns out that this information is not
        exactly available anywhere on a BIG-IP. Instead, we rely on a semi-reliable
        means for determining what the type of the virtual server is. Hopefully it
        always works.

        There are a handful of attributes that can be used to determine a specific
        type. There are some types though that can only be determined by looking at
        the profiles that are assigned to them. We follow that method for those
        complicated types; message-routing, fasthttp, and fastl4.

        Because type determination is an expensive operation, we cache the result
        from the operation.

        Returns:
            string: The server type.
        R_s
forwarding-l2s
forwarding-ipRVRWtdhcpRYsperformance-httpsperformance-l4smessage-routingtstandard(R�RTR�RURVRWRXRYR�R�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR_Ds.
												
cC`sB|jddkrdS|j}|j|j|j|j�}|S(NRM(R�R�tdestination_tupleR�R�R^R�(RRMR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRMqs
	c	C`s�tdddddg�}|jddkrS|dddddddd�}|Stjdd|jd�}d	}tj||�}|ryt|jd��}Wn5tk
r�|jd�}|d
kr�d}q�nX|d|jd�d|dt|jd��d|j	�}|Sd}tj||�}|r||d|jd�dddt|jd��d|j	�}|Sd
}tj||�}|r�|d|jd�dt|jd��ddd|j	�}|Sd}tj||�}|r |d|ddddd|j	�}|Sd}tj||�}|r�|jd�j
d�d}yt|jd��}Wn5tk
r�|jd�}|d
kr�d}q�nX|d|d|ddd|j	�}|Sd}tj||�}|r1|d|jd�dt|jd��ddd|j	�}|Sd}tj||�}|r�|d|jd�ddddd|j	�}|Sd}tj||�}|r�|d|jd�d|jd�ddd|j	�}|S|dddddddd�}|S(NtDestinationR�R^R�R[RMs^/[a-zA-Z0-9_.-]+/ts>(?P<ip>[^%]+)%(?P<route_domain>[0-9]+)[:.](?P<port>[0-9]+|any)R�is&(?P<ip>[^%]+)%(?P<route_domain>[0-9]+)s�^(?P<ip>(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])):(?P<port>[0-9]+)s(^([0-9a-f]{0,4}:){2,7}(:|[0-9a-f]{1,4})$sC(?P<ip>([0-9a-f]{0,4}:){2,7}(:|[0-9a-f]{1,4}).(?P<port>[0-9]+|any))t.s+(?P<name>^[a-zA-Z0-9_.-]+):(?P<port>[0-9]+)R�s(?P<name>^[a-zA-Z0-9_.-]+)s"(?P<ip>[^.]+).(?P<port>[0-9]+|any)(RR�R�tretsubtsearchR�tgroupR�R[tsplit(RR�R�RMtpatterntmatchesR^R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�ys�!	



!cC`s |j}|j|jd<|jS(NR^(R�R^R�(RRM((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR^�s	cC`s&|j}|j|jd<t|j�S(suReturn a route domain number from the destination

        Returns:
            int: The route domain number
        R�(R�R�R�R�(RRM((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�s	c
C`s�d|jdkrd
Sg}xw|jddD]d}|d}|d}|dkr~|jtd|d|d|d��q/td	j|���q/W|S(s9Returns a list of profiles from the API

        The profiles are formatted so that they are usable in this module and
        are able to be compared by the Difference engine.

        Returns:
             list (:obj:`list` of :obj:`dict`): List of profiles.

             Each dictionary in the list contains the following three (3) keys.

             * name
             * context
             * fullPath

        Raises:
            F5ModuleError: If the specified context is a value other that
                ``all``, ``serverside``, or ``clientside``.
        R�R*tcontextR�tallt
serversidet
clientsidetfullPaths$Unknown profile context found: '{0}'N(sallR�R�(R�R�tappendtdictRR�(RR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR*
s

)cC`s$gt|j�D]}|d^qS(NR�(R
R*(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt
profile_types/scC`smd|jdkrdSg}xI|jddD]6}|d}|d}|jtd|d|��q/W|S(NR�R,R�R�(R�R�R�R�(RR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR,3s

 cC`s&|jddkrdS|jddS(s_Get the name of the current default persistence profile

        These persistence profiles are always lists when we get them
        from the REST API even though there can only be one. We'll
        make it a list again when we get to the Difference engine.

        Returns:
             string: The name of the default persistence profile
        R$iN(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$>scC`sd|jkrtStS(NRO(R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyROMscC`sd|jkrtStS(NRN(R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRNSscC`s�|jddkrdSt|jd�r.dSg}x�|jdD]u}|dttgkrdqBntdt|d��}d|kr�t|d�|d<n
d|d<|j|�qBW|S(NRPR�tvalueR�(R�R�RR
RR�R�R�(RR�tmdttmp((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRPYs
cC`sZ|jddkrdSttg|jdD]}|jd�^q+��}|j�|S(NR:t"(R�R�tlisttsettstriptsort(RR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR:ls
5
cC`sM|jddkrdSd|jdkr.dS|jdddkrItStS(NR<tuseDevicePolicytno(R�R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytsec_nat_use_device_policyzscC`sM|jddkrdSd|jdkr.dS|jdddkrItStS(NR<tuseRouteDomainPolicyR�(R�R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytsec_nat_use_rd_policy�scC`s=|jddkrdSd|jdkr.dS|jddS(NR<tpolicy(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytsec_nat_policy�s
cC`s"|jddkrgS|jdS(NR.(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR.�scC`s?|jddkrdS|jddkr.dSt|jd�S(NRBRNi(R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRB�s
cC`s{|jddkrdSg}xW|jdD]H}t|d|d�}|d}i|d6|d6}|j|�q+W|S(NRJR�R�R�(R�R�RR�(RR�R�t	pool_nameR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRJ�s

(R�R�R�R_RMR�R^R�R*R�R,R$RORNRPR:R�R�R�R.RBRJ(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�Cs&-�"

tModuleParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6Zd�Zd�Zd�Zd�Zed ��Zed!��Z	ed"��Z
ed#��Zed$��Zed%��Z
ed&��Zed'��Zed(��Zed)��Zed*��Zed+��Zed,��Zed-��Zed.��Zed/��Zed0��Zed1��Zed2��Zed3��Zed4��Zed5��Zed6��Zed7��Zed8��Z ed9��Z!ed:��Z"ed;��Z#ed<��Z$ed=��Z%ed>��Z&ed?��Z'ed@��Z(edA��Z)edB��Z*edC��Z+edD��Z,edE��Z-RS(FiRhiPRdi�thttpsittelneti�Rkitsmtpi�tsnmpi�s	snmp-trapitsshiERii�tisakmpi[tmqtti�"smqtt-tlsi*RccC`sld|krd|d<nd|kr4td��n|djdd�|d<|djdd�|d<dS(	NR�R�R�s=A profile name must be specified when a context is specified.sserver-sideR�sclient-sideR�(Rtreplace(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_handle_profile_context�s
cC`s�|ddks|j|�r?|ddkr?d|d<q?n|ddks^|j|�r~|ddkr~d|d<q~ndS(NR�t	serversslR�R�t	clientsslR�(R�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_handle_ssl_profile_nuances�scC`sgyt|jd�}Wntk
r6td��nXd|koNdknrW|Std��dS(NR^s*The specified port was not a valid integerii��s&Valid ports must be in range 0 - 65535(R�R�R�R(RR^((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_check_port�s

cC`s�d}d}xO|jdD]@}|ddkr=|d7}n|ddkr|d7}qqW|dksv|dkr�td��ndS(NiRJR�R�iR�s6You must specify only one clone pool for each context.(R�R(RR�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_check_clone_pool_contexts�s
cC`s�|jddkrdS|j}tdj|j|j��r�|jrhdj|j|j|j�}ndj|j|j�}|Std��dS(NRRu{0}/{1}s{0}%{1}/{2}s{0}/{1}sBThe source IP address must be a valid CIDR format: address/prefix.(	R�R�tsource_tupleRR�R�tcidrR�R(RRRR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRR�s		!cC`stddddg�}|jddkrJ|dddddd�}|Sd}tj||jd�}|r�|d|jd�d|jd�d|jd��}|Sd}tj||jd�}|r�|d|jd�ddd|jd��}|S|dddddd�}|S(NtSourceR�R�R�RRs7(?P<ip>[^%]+)%(?P<route_domain>[0-9]+)/(?P<cidr>[0-9]+)s(?P<ip>[^%]+)/(?P<cidr>[0-9]+)(RR�R�R�R�R�(RR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�s,cC`s�d}t|jdjd��dkri|jdjd�\}}d|kr�|jd�d}q�n|jdjd�d}t|�s�tj||�}|s�td��q�n|j||j|j	�}|S(Ns^[a-zA-Z0-9_.-]+RMt/it%isMThe provided destination is not a valid IP address or a Virtual Address name.(
R�R�R�RR�R�RR�R^R�(RR�taddrtdudR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRM!s"cC`s�|jddkrdSd}t|jdjd��dkr||jdjd�\}}d|kr�|jd�}q�n|jdjd�}|r�t|�dkr�d}tj||d�}|r�t|d�r�dSt|d�SdS(NRMR�iR�s^[a-zA-Z0-9_.-]+i(R�R�R�R�R�R�RR�(RR�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�3s"c	C`s�tdddddg�}|jddkrS|dddddddd�}|S|jdjd�djd	�d}t|�r�td
j|��}n|d|d|jd|jd|j	�}|S(NR�R�R^R�R[RMR�iR�u{0}(
RR�R�R�RRR�R^R�R[(RR�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�Gs!'*cC`s
|jddkrdSt|jdjd��dkr�|jdjd�\}}d|kr|jd�dd|}q�|jd}n|jdjd�d}|dkr�d	S|dkr�d
S|jddkr�t|�r�t|�SdSnt|jd�S(NRMR�iR�is0.0.0.0s0.0.0.0/anys	0.0.0.0/0R�s::s::/0s::/any6tany6R[(s0.0.0.0s0.0.0.0/anys	0.0.0.0/0(s::s::/0s::/any6(R�R�R�R�RRR(RR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR[Ss""
cC`s�|jddkrdS|jddkr.dS|jd|jkrh|jd}|j||jd<n|j�t|jd�S(NR^t*R�t0i(R�sanyR�(R�R�tservices_mapR�R�(RR^((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR^js

cC`s�g}|jddkrdSt|jd�dkrQ|jdddkrQdSx4|jdD]%}t|j|�}|j|�q_W|S(NR.iiR�(R�R�R�RR�R�(RtresultstiruleR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR.vs0cC`s�|jddkrdSt|jd�dkrK|jdddkrKdSg}x�|jdD]�}t�}t|t�r�|j|�|j|�d|kr�||d<nt|j|d�|d<|j	|�nIt|j|�}t
jj|�|d<d|d<||d<|j	|�|j
|�q_Wg|D]}||jkr;|d^q;}t|�dkr�td	jd
j|j�j����n|S(NR*iiR�R�R�R�R�s#Profiles {0} are mutually exclusives, (R�R�R�R�t
isinstancetupdateR�RR�R�tostpathtbasenameR�R�RR�tjoinR�(RR�R�R�t	full_pathR�tmutually_exclusive((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR*�s40	





,!cC`s|jddkrdSt|jd�dkrK|jdddkrKdSg}g|jdD]}t|j|�^q_}t|�}xq|D]i}|jd�}t|�dkr�tdj|���nt	d|d	d
|d�}|j
|�q�W|S(NR,iiR�R�is'The specified policy '{0}' is malformedR�iR�(R�R�R�RR�R�R�RR�R�R�(RR�tpR,R�tpartsR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR,�s"0,


cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NRQR�(R�R�RR�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRQ�s
cC`sI|jddkrdS|jdtkr.tS|jddkrEtStS(NR]R&R\(R�R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR&�scC`sI|jddkrdS|jdtkr.tS|jddkrEtStS(NR\R(R](R�R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR(�scC`s�|jddkrdStd�|jdD��rMt|jd�g}|Sttg|jdD]}t|j|�^qa��}|j�|S(NR]cs`s-|]#}|j�dkr|j�VqdS(R�R�N(sallR�(tlower(t.0R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>�sR�(R�R�R�RR�R�R�R�(RR�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR]�s8
cC`s�|jddkrdStd�|jdD��rCtd��nttg|jdD]}t|j|�^qW��}|j�|S(NR\cs`s-|]#}|j�dkr|j�VqdS(R�R�N(sallR�(R(R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>�ss>You cannot disable all VLANs. You must name them individually.(	R�R�R�RR�R�RR�R�(RR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR\�s8
cC`s|j}|r|jS|jS(N(R\R](RRN((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRS�s	cC`s"|jddkrdS|jdS(NtstatetpresentRO(R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR
�scC`so|jddkrdS|jdj�}|dkrCtd|�St|j|jd�}td|dd�S(NR tautomaptnoneR_RQ(RR
(R�R�RR�RR�(Rt	lowercaset	snat_pool((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR �s
cC`s�|jddkrdS|jddkr.dSt|j|jd�}|jd�}t|�dkrwtd��ntd|dd|d	�}|S(
NR$R�R�is8The specified 'default_persistence_profile' is malformedR�iR�i(R�R�RR�R�R�RR�(RR�RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$s

cC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NR"R�(R�R�RR�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR"scC`s6|jddkrtS|jddkr.tSdSdS(NR
RORN(R�R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyROs
cC`s6|jddkrtS|jddkr.tSdSdS(NR
RORN(R�R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRN(s
cC`s�|jddkrdS|jddkr.gSg}ymxft|jd�D]Q\}}tdt|��}|r�t|�|d<n
d|d<|j|�qKWWntk
r�td��nX|S(NRPR�R�R�sAThe 'metadata' parameter must be a dictionary of key/value pairs.(R�R�R
R�R�R�tAttributeErrorR(RR�tktvR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRP1s  


cC`s,|jddkrdS|jdr(dSdS(NR0RORN(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR0Fs

cC`s,|jddkrdS|jdr(dSdS(NR2RORN(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR2Ns

cC`s.|jddkrdSt|j|jd�S(NR6(R�R�RR�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR6VscC`s.|jddkrdSt|j|jd�S(NR8(R�R�RR�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR8\scC`sE|jddkrdS|jddkr.dSt|j|jd�S(NR@R�R
(R�snone(R�R�RR�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR@bs
cC`s�|jddkrdSt|jd�dkrK|jdddkrKdSttg|jdD]}t|j|�^q_��}|j�|S(NR:iiR�(R�R�R�R�R�RR�R�(RR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR:js08
cC`s=|jddkrdSd|jdkr.dS|jddS(NR<tuse_device_policy(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�ts
cC`s=|jddkrdSd|jdkr.dS|jddS(NR<tuse_route_domain_policy(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�|s
cC`sd|jddkrdSd|jdkr.dS|jdddkrIdSt|j|jdd�S(NR<R�R�(R�R�RR�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR��scC`snt�}|jr"|j|d<n|jdk	rA|j|d<n|jdk	r`|j|d<n|rj|SdS(NR�RR(R�R�R�R�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR<�s		cC`s7t|jd�}|dkr#dS|dkr3dSdS(NRZtyesRORN(RR�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRZ�scC`sa|jddkrdSdt|jd�ko;dknrQt|jd�Std��dS(NRBiI����s3Valid 'rate_limit' must be in range 0 - 4294967295.(R�R�R�R(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRB�s)cC`sa|jddkrdSdt|jd�ko;dknrQt|jd�Std��dS(NRHiI����s<Valid 'rate_limit_src_mask' must be in range 0 - 4294967295.(R�R�R�R(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRH�s)cC`sa|jddkrdSdt|jd�ko;dknrQt|jd�Std��dS(NRFiI����s<Valid 'rate_limit_dst_mask' must be in range 0 - 4294967295.(R�R�R�R(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRF�s)cC`s�|jddkrdSt|jd�dkrQ|jdddggkrQgS|j�g}x_|jdD]P}t|j|j|d��}|d}i|d6|d6}|j|�qoW|S(NRJiiR�R�R�R�(R�R�R�R�RR�R�R�(RR�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRJ�s6


(.R�R�R�R�R�R�R�R�RRR�RMR�R�R[R^R.R*R,RQR&R(R]R\RSR
R R$R"RORNRPR0R2R6R8R@R:R�R�R�R<RZRBRHRFRJ(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR��sr
				
	
 
			


	


tChangescB`seZRS((R�R�(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�st
UsableChangescB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed	��Zed
��Z
ed��Zed��Zed
��Zed��ZRS(cC`s"|jddkrdS|jdS(NR_RYRM(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRM�scC`s`|jddkrdSt|jd�dkr4gStd�|jdD��rUgS|jdS(NRSics`s'|]}|j�dkr|VqdS(s/common/allR�N(s/common/allsall(R(R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>�s(R�R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRS�scC`sP|jddkrdS|jddkr.dS|jddkrEgS|jdS(	NR.R_R�RVRWRYR�(sdhcps	statelesssrejectsinternal(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR.�scC`sP|jddkrdS|jddkr.dS|jddkrEgS|jdS(NR,R_R�RWRYR�(sdhcpsrejectsinternal(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR,�scC`sM|jddkrdS|jddkr.dS|jds?gS|jdgS(NR$R_R�(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$�s
cC`s9|jddkrdS|jddkr.dS|jdS(NR"R_R�(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR"	s
cC`s9|jddkrdS|jddkr.dS|jdS(NR R_R�RWRY(sdhcpsrejectsinternal(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR 	s
cC`s|jddkrtSdS(NR_R�(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRX	scC`s|jddkrtSdS(NR_RW(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRW	scC`s|jddkrtSdS(NR_RV(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRV"	scC`s|jddkrtSdS(NR_RY(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRY'	scC`s|jddkrtSdS(NR_s
forwarding-ip(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRU,	scC`s|jddkrtSdS(NR_s
forwarding-l2(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRT1	scC`sr|jddkrdSd}tg|jdD]}|j|�r.|^q.�dkrgtd��n|jdS(NR:sLog all requestssLog illegal requestsisIThe 'Log all requests' and 'Log illegal requests' are mutually exclusive.(sLog all requestssLog illegal requests(R�R�R�tendswithR(RtmutexR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR:6	s;cC`s�|jddkrdSt�}|jd}d|krJ|d|d<nd|krs|drfdnd|d<nd|kr�|dr�dnd|d<n|r�|SdS(	NR<R�RRR�R�RR�(R�R�R�(RR�tsec((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR<A	s	
(R�R�R�RMRSR.R,R$R"R RXRWRVRYRURTR:R<(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�s



tReportableChangescB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed	��Zed
��Z
ed��ZRS(cC`s2|jddkrdS|jddkr.dSdS(NRZRORR�(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRZS	s
cC`sm|jddkrdS|jdjdd�}|dkr@dS|dkrPdS|jdjdd�}|S(NR R_RtAutomapR
RQ(R�R�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR [	scC`s/tdtd|jd��}|jj}|S(NtparamsRM(R�R�R�R�R�(RRR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRMg	scC`s/tdtd|jd��}|jj}|S(NRRM(R�R�R�R�R^(RRR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR^m	scC`sLt|jd�dkrgS|jdd}dj|d|d�}|S(NR$is/{0}/{1}R�R�(R�R�R�(RR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$s	s
cC`s�t|jd�dkrgSt|jd�dkrQ|jdddkrQdSg|jdD] }dj|d|d�^q_}|S(NR,iiR�s/{0}/{1}R�R�(R�R�R�(RR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR,{	s04cC`s\t|jd�dkrgSt|jd�dkrQ|jdddkrQdS|jdS(NR.iiR�(R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR.�	s
0cC`skt|jd�dkr0|jdtkr0dSt|jd�dkrg|jdtkrg|jdSdS(NRSiR(R�R&(R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR]�	s,,cC`s;t|jd�dkr7|jdtkr7|jdSdS(NRSiR((R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR\�	s,cC`s|jddkrtStS(NR0RO(R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR0�	scC`s|jddkrtStS(NR2RO(R�R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR2�	sc`s�jddkrdSyt�jd�Wntk
rG�jdSXt�fd��jD�d�}|rt|S�jdS(NR4c3`s0|]&}|d�jdkr|dVqdS(iR4iN(R�(R	R�(R(sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>�	s(R�R�R�R�tnextR�(Rtprotocol((RsS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR4�	s
"(R�R�R�RZR RMR^R$R,R.R]R\R0R2R4(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRR	s	tVirtualServerValidatorcB`seZddddd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`sF|r|nt�|_|r$|nt�|_||_||_dS(N(R�thaveR�twantR�tmodule(RR#R�R"R!((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt__init__�	s	cC`sr|j�|j�|j�|j�|j�|j�|j�|j�|j�|j	�|j
�dS(N(t_override_port_by_typet_override_protocol_by_typet!_verify_type_has_correct_profilest,_verify_default_persistence_profile_for_typet-_verify_fallback_persistence_profile_for_typet_update_persistence_profilet"_ensure_server_type_supports_vlanst$_verify_type_has_correct_ip_protocolt_verify_dhcp_profilet_verify_fastl4_profilet_verify_stateless_profile(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytcheck_update�	s









cC`s�|j�|j�|j�|j�|j�|j�|j�|j�|j�|j	�|j
�|j�|j�|j
�|j�|j�|j�dS(N(t_set_default_ip_protocolt_set_default_profilesR%R&R'R(R)R*t'_verify_virtual_has_required_parametersR+t _override_vlans_if_all_specifiedt#_check_source_and_destination_matchR,t_verify_minimum_profileR-R.t#_verify_stateless_profile_on_create(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytcheck_create�	s"















cC`s;|jjdkrdS|jjdkr7td��ndS(s	Verifies the specified server type supports VLANs

        A select number of server types do not support VLANs. This method
        checks to see if the specified types were provided along with VLANs.
        If they were, the module will raise an error informing the user that
        they need to either remove the VLANs, or, change the ``type``.

        Returns:
            None: Returned if no VLANs are specified.
        Raises:
            F5ModuleError: Raised if the server type conflicts with VLANs.
        NRYs2The 'internal' server type does not support VLANs.(R"R]R�R_R(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR+�	s

c`soddg�|jjdk	rkt�fd�|jjD��rk|jjtdgdtdt��qkndS(sIOverrides any specified VLANs if "all" VLANs are specified

        The special setting "all VLANs" in a BIG-IP requires that no other VLANs
        be specified. If you specify any number of VLANs, AND include the "all"
        VLAN, this method will erase all of the other VLANs and only return the
        "all" VLAN.
        s/common/allR�c3`s'|]}|j��kr|VqdS(N(R(R	R�(t	all_vlans(sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>�	sR]R(R&N(R"R]R�R�R�R�R�R�(R((R9sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR4�	s"	cC`s\|jjdkr,|jjidd6�n,|jjdkrX|jjidd6�ndS(NR�iCR^RYi(R"R_R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR%
scC`s0|jjdkr,|jjidd6�ndS(NRViR4(s	stateless(R"R_R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR&
scC`s�|jjr�|jjr�tdj|jjj|jjj��}tdj|jjj��}|j	|j	kr�t
d��q�ndS(s�Verify that destination and source are of the same IP version

        BIG-IP does not allow for mixing of the IP versions for destination and
        source addresses. For example, a destination IPv6 address cannot be
        associated with a source IPv4 address.

        This method checks that you specified the same IP version for these
        parameters

        Raises:
            F5ModuleError: Raised when the IP versions of source and destination differ.
        u{0}/{1}u{0}sdThe source and destination addresses for the virtual server must be be the same type (IPv4 or IPv6).N(R"RRRMRR�R�R�R�R�tversionR(RR"R!((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR5
s
*cC`s^|jjdkrdS|jjdkrL|jjdkrZtd��qZn|jjd	kr�|jjdkrZtd
��qZn�|jjdkr�|jjdkrZtd��qZn�|jjd
kr�|jjdk	rZtd��qZnl|jjdkr$|jjdkrZtd��qZn6|jjdkrZ|jjdkrZtd��qZndS(NR�iii�i3i2R�sHThe 'standard' server type does not support the specified 'ip_protocol'.sperformance-httpsPThe 'performance-http' server type does not support the specified 'ip_protocol'.RVsIThe 'stateless' server type does not support the specified 'ip_protocol'.R�s9The 'dhcp' server type does not support an 'ip_protocol'.RYsHThe 'internal' server type does not support the specified 'ip_protocol'.smessage-routingR�sOThe 'message-routing' server type does not support the specified 'ip_protocol'.(iii�i3i2sany(i(i(ii(iii�sallsany(R"R4R�R_R(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR,&
s4c`s^ddg}�jjdkr"dSt�fd�|D��rZtddj|���ndS(s*Verify that the virtual has required parameters

        Virtual servers require several parameters that are not necessarily required
        when updating the virtual. This method will check for the required params
        upon creation.

        Ansible supports ``default`` variables in an Argument Spec, but those defaults
        apply to all operations; including create, update, and delete. Since users are not
        required to always specify these parameters, we cannot use Ansible's facility.
        If we did, and then users would be required to provide them when, for example,
        they attempted to delete a virtual (even though they are not required to delete
        a virtual.

        Raises:
             F5ModuleError: Raised when the user did not specify required parameters.
        RMR^RYNc3`s'|]}t�j|�dkVqdS(N(R|R"R�(R	R(R(sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>t
ssYou must specify both of s, (R"R_R�RR(Rtrequired_resources((RsS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR3`
scC`sLddddddg}|jj|krHtdj|jj���ndS(	s�Verify that the server type supports default persistence profiles

        Verifies that the specified server type supports default persistence profiles.
        Some virtual servers do not support these types of profiles. This method will
        check that the type actually supports what you are sending it.

        Types that do not, at this time, support default persistence profiles include,

        * dhcp
        * message-routing
        * reject
        * stateless
        * forwarding-ip
        * forwarding-l2

        Raises:
            F5ModuleError: Raised if server type does not support default persistence profiles.
        R�smessage-routingRWRVs
forwarding-ips
forwarding-l2sFThe '{0}' server type does not support a 'default_persistence_profile'N(R"R4RR�R_(Rtdefault_profile_not_allowed((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR(y
scC`sOdddddddg}|jj|krKtdj|jj���nd	S(
s�Verify that the server type supports fallback persistence profiles

        Verifies that the specified server type supports fallback persistence profiles.
        Some virtual servers do not support these types of profiles. This method will
        check that the type actually supports what you are sending it.

        Types that do not, at this time, support fallback persistence profiles include,

        * dhcp
        * message-routing
        * reject
        * stateless
        * forwarding-ip
        * forwarding-l2
        * performance-http

        Raises:
            F5ModuleError: Raised if server type does not support fallback persistence profiles.
        R�smessage-routingRWRVs
forwarding-ips
forwarding-l2sperformance-httpsGThe '{0}' server type does not support a 'fallback_persistence_profile'N(R"R4RR�R_(RR<((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR)�
s
	cC`s6|jjdk	r2|jji|jjd6�ndS(NR$(R"R$R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR*�
scC`s�|jjdkrf|jjr-td��n|jjrHtd��n|jjr�td��q�n�|jjdkr�|jjs�td��q�n`|jjdkr�|jjs�td��q�n0|jjd	kr�|jjs�td
��q�ndS(s�Verify that specified server type does not include forbidden profiles

        The type of the server determines the ``type``s of profiles that it accepts. This
        method checks that the server ``type`` that you specified is indeed one that can
        accept the profiles that you specified.

        The common situations are

        * ``standard`` types that include ``fasthttp``, ``fastl4``, or ``message routing`` profiles
        * ``fasthttp`` types that are missing a ``fasthttp`` profile
        * ``fastl4`` types that are missing a ``fastl4`` profile
        * ``message-routing`` types that are missing ``diameter`` or ``sip`` profiles

        Raises:
            F5ModuleError: Raised when a validation check fails.
        R�s3A 'standard' type may not have 'fasthttp' profiles.s1A 'standard' type may not have 'fastl4' profiles.s:A 'standard' type may not have 'message-routing' profiles.sperformance-https<A 'fasthttp' type must have at least one 'fasthttp' profile.sperformance-l4s8A 'fastl4' type must have at least one 'fastl4' profile.smessage-routingsHA 'message-routing' type must have either a 'sip' or 'diameter' profile.N(R"R_R�RR�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR'�
s cC`sF|jjdkrdS|jjdkrB|jjidd6�ndS(NR�iR4(R"R_R4R�R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR1�
scC`s�|jjdkr�|jjs�|jjdkrM|jjidgd6�n|jjdkr||jjidgd6�n|jjdkr�|jjidgd6�q�q�ndS(	NR�iRxR*iRyi�Rw(R"R_R*R4R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR2�
s
cC`sG|jjrdS|jjdkrC|jjdkrCtd��ndS(NRYR�s�An 'internal' server must have at least one profile relevant to its 'ip_protocol'. For example, 'tcp', 'udp', or variations of those.(R"R*R�R_R(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR6�
s
$cC`s�|jjdkrdS|jjdkr,dSt|j��}tg|jjD]}|d^qN�}|j|�rztStd��dS(NR�R�sVA dhcp profile, such as 'dhcpv4', or 'dhcpv6' must be specified when 'type' is 'dhcp'.(	R"R_R*R�R�tread_dhcp_profiles_from_devicetintersectionR�R(RR!R�R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR-�
s)cC`s�|jjdkrdS|jjdkr,dSt|j��}tg|jjD]}|d^qN�}|j|�rztStd��dS(Nsperformance-l4R�s^A performance-l4 profile, such as 'fastL4', must be specified when 'type' is 'performance-l4'.(	R"R_R*R�R�t read_fastl4_profiles_from_deviceR>R�R(RR!R�R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR.s)cC`s�|jjdkrdS|jjdkr,dSt|j��}tg|jjD]}|d^qN�}|j|�rztStd��dS(Nsperformance-httpR�sdA performance-http profile, such as 'fasthttp', must be specified when 'type' is 'performance-http'.(	R"R_R*R�R�t"read_fasthttp_profiles_from_deviceR>R�R(RR!R�R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_verify_fasthttp_profiles)cC`sA|jjdkrdS|j�}|dkr=td��ndS(NRVs<A udp profile, must be specified when 'type' is 'stateless'.(R"R_R/R�R(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR7"scC`s�|jjdkrdS|jjdkr,dSt|j��}tg|jjD]}|d^qN�}|j|�rztStd��dS(NRVR�s<A udp profile, must be specified when 'type' is 'stateless'.(	R"R_R*R�R�tread_udp_profiles_from_deviceR>R�R(RR!R�R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR/+s)cC`s*g}||j�7}||j�7}|S(N(t read_dhcpv4_profiles_from_devicet read_dhcpv6_profiles_from_device(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR=8scC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}t
|jj|d�^q�}|S(	Ns+https://{0}:{1}/mgmt/tm/ltm/profile/dhcpv4/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�RR"R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRC>s
0cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}t
|jj|d�^q�}|S(	Ns+https://{0}:{1}/mgmt/tm/ltm/profile/dhcpv6/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�RR"R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRDQs
0cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}t
|jj|d�^q�}|S(	Ns+https://{0}:{1}/mgmt/tm/ltm/profile/fastl4/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�RR"R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR?ds
0cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}t
|jj|d�^q�}|S(	Ns-https://{0}:{1}/mgmt/tm/ltm/profile/fasthttp/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�RR"R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR@ws
0cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��ng|dD]}t
|jj|d�^q�}|S(	Ns(https://{0}:{1}/mgmt/tm/ltm/profile/udp/R�R�R�i�R�R�R�(
R�R�R�R�R�R�R�RR�R�RR"R�(RR�R�R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRB�s
0N(R�R�R�R$R0R8R+R4R%R&R5R,R3R(R)R*R'R1R2R6R-R.RAR7R/R=RCRDR?R@RB(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR �	s8								:					"					
	
	
			
					t
DifferencecB`s�eZdd�Zd�Zd�Zd�Zd�Zd�Ze	d��Z
e	d��Ze	d��Ze	d	��Z
e	d
��Ze	d��Ze	d��Ze	d
��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��Ze	d��ZRS(cC`s||_||_dS(N(R!R"(RR"R!((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$�s	cC`s?yt||�}|SWn!tk
r:|j|�}|SXdS(N(R|Rt_Difference__default(RtparamR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytcompare�s
cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R|R"R!R(RRGtattr1tattr2((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt	__default�s
cC`s\g}xO|D]G}gt|�D]$\}}t|�t|�f^q }||7}q
W|S(N(R
R�(RR�R�R�RRR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytto_tuple�s

7cC`sq|gkr|dkrdS|dkr,dS|j|�}|j|�}t|�jt|��ridS|SdS(N(R�RLR�tissubset(RR"R!twth((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_diff_complex_items�scC`s�|jjdk	rQ|jj|jjkr�|jj|d<|jj|d<q�n�|jjdk	r�td�|jjD��r�|jjtkr�t|d<t|d<q�q�|jj|jjkr�|jj|d<|jj|d<q�ndS(NR(R&cs`s$|]}|j�jd�VqdS(s/allN(RR(R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>�s(	R"R(R�R!R&R�RSR�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt_update_vlan_status�s
cC`s8|jjdkrdS|jj|jj|jjg}td�|D��rQdS|jj}|jjdkr�|jj	i|jd6�n|jjdkr�|jj	i|jd6�n|jjj
dkr�|j
}n|jjj
}|jj||jj|jj�}||jjkr4t|jj
|�SdS(NRYcs`s|]}|dkVqdS(N(R�(R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>�sR^R�(R"R_RMR^R�R�R�R!R�R�R�R�RR�(Rt
addr_tupleR!R�R"((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRM�s !$cC`s<|jjdkrdS|jj|jjkr8|jjSdS(N(R"RRR�R!(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRR�scC`s�|jjdkrdS|jjgkr>|jjdkr>dS|jj|jjkrZdStd�|jjD��r�|jjdkr�dSgSn
|jjSdS(Ncs`s$|]}|j�jd�VqdS(s/allN(RR(R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>s(R"RSR�R!R�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRS�s$	cC`s|jS(N(tvlan_status(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR]scC`s|jS(N(RS(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR\scC`s<t�}|j}|dk	r+||d<n|j|�|S(NRS(R�RSR�RQ(RR�RS((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRSs		

cC`s&|j}|dk	r"td|�SdS(NRM(RMR�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR^s	c	C`s|jjdkrdS|jjdkr�t|jj�dkr�tg|jjD]!}|d|d|df^qP�}t|jj�dkr�td�|D��s�gSdSq�gSn|jjdkr�t|jj�dkr�dStg|jjD]!}|d|d|df^q��}tg|jjD]!}|d|d|df^q2�}t|�dkrx|jjSt|�dkr�||kr|jjSnrtd�|D��s|jjd	krtg|D]}|dd
kr�|^q��}qntd�|D��sHtg|D]}|ddkr |^q �}ntd
�|D��s�|jjd	kr�tg|D]}|ddkrz|^qz�}q�ntg|D]}|d|df^q��}tg|D]}|d|df^q��}||kr|jjSdS(NR�iR�R�R�ics`s|]}|ddkVqdS(iRxRyRwN(stcpsudpssctp((R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>+scs`s|]}|ddkVqdS(iRxN((R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>;sRVRxcs`s|]}|ddkVqdS(iRyN((R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>>sRycs`s|]}|ddkVqdS(iRwN((R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>@sRwi(R"R*R�R�R!R�R�R_(RRR!R"R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR*$s<*:*::

525--cC`s&|jj|jjkr"|jjSdS(N(R"R4R!(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR4HscC`s�|jjdkrdS|jjdkr>|jjdk	r>dS|jjdkrf|jjdkrfdS|jj|jjkr�|jjSdS(NR�(R"R"R�R!(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR"Ms$$cC`s|jjdkrdS|jjdkr>|jjdk	r>gS|jjdkrf|jjdkrfdS|jjdkr�td|jj�S|jjjdd�}|jjjdd�}|jjjdd�}|jjjdd�}||ks||krtd|jj�SdS(NR�R$R�R�(R"R$R�R!R�R�(Rtw_nametw_partitionth_nameth_partition((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$Xs $$
cC`s�|jjdkrdS|jjdkr>|jjdk	r>dS|jjdkrf|jjdkrfdS|jj|jjkr�|jjSdS(NR�(R"R@R�R!(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR@ms$$cC`s|jjdkrdS|jjgdgkrD|jjdkrDdS|jjdkrrt|jj�dkrrgS|jjs�|jjStg|jjD]}|d|df^q��}tg|jjD]}|d|df^q��}||ks|jjSdS(NR�iR�R�(R"R,R�R!R�R�(RRR"R!((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR,xs**
33cC`s�|jjdkrdS|jjd|jjdkrOtd|jj�}|S|jjjdd�dkrqdS|jjd|jjdkr�td|jj�}|SdS(NR_R RQ(R"R R�R!R�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR �s  cC`sr|jjdkr7|jjr7tdtdt�}|S|jjdkrn|jjrntdtdt�}|SdS(NRORN(R"R
R!RNR�R�R�RO(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRO�s		cC`s�|jjdkrdS|jjdkrDt|jj�dkrDgS|jjgdgkrxt|jj�dkrxdStt|jj��tt|jj��kr�|jjSdS(NR�i(R"R.R�R�R!tsortedR�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR.�s*00cC`s�|jjdkrdS|jjdkr>|jjdk	r>dS|jjdkrf|jjdkrfdS|jj|jjkr�|jjSdS(NR�(R"RQR�R!(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRQ�s$$cC`s�|jjdkrdSt|jj�dkrD|jjdkrDdSt|jj�dkrm|jjrmdSt|jj�dkr�|jjr�gS|jjdkr�|jjS|j|jj|jj�}|S(Ni(R"RPR�R�R!tinsert_metadataRP(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRP�s*%$
cC`s+|jj|jjkr'td��ndS(Ns/Changing the 'type' parameter is not supported.(R"R_R!R(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR_�scC`st|jj|jj�}|S(N(RR"R:R!(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR:�scC`st�}|jjdk	rI|jj|jjkrI|jj|d<qIn|jjdk	r�|jj|jjkr�|jj|d<q�n|jjdk	r�|jjdkr�|jjdkr�q�|jj|jjkr�|jj|d<q�n|rtd|�SdS(NRRR�R�R<(R�R"R�R�R!R�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR<�s	$cC`sJ|jjgkr(|jjr(|jjS|j|jj|jj�}|S(N(R"RJR!RP(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRJ�s
N( R�R�R�R$RHRFRLRPRQR�RMRRRSR]R\RSR^R*R4R"R$R@R,R ROR.RQRPR_R:R<RJ(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRE�s8							$t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(cO`sy|jdd�|_t|jj�|_td|j�|_td|jd|jj�|_	t
�|_g|_dS(NR#R�R(
R�R�R#RRR�R�R!R�R"Rtchangestprovisioned_modules(Rtargstkwargs((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$�s!cC`s�t}t�}|jj}t|j�|_|dkrH|j�}n|dkrc|j�}nt	d|j
j��}|j�}|j|�|jtd|��|S(NRRORNtabsentRtchanged(spresentsenabledsdisabled(
R�R�R"R
RR�R\RR_RR[R�R�(RR`R�R
t
reportableR[((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytexec_module�s	
cC`s$|j�r|j�S|j�SdS(N(texistsR�tcreate(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR

s
cC`s|j�r|j�StS(N(RctremoveR�(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR_
s
c	C`s�|j�|_td|jd|jd|jd|j�}|j�|jjdk	r�t	d�|j
D��s�td��q�n|j�s�t
S|jjr�tS|j�tS(NR#R�R!R"cs`s!|]}|dkr|VqdS(tafmtasmN(RfRg((R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>
ss?AFM must be provisioned to configure an IP Intelligence policy.(tread_current_from_deviceR!R R#R�R"R0R@R�R�R\Rt
should_updateR�t
check_modeR�tupdate_on_device(Rt	validator((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR�
s'

cC`s|j�}|rtStS(N(t_update_changed_optionsR�R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRi)
scC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource(R#RjR�tremove_from_deviceRcR(R((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRe/
s
cC`std|jj��}|S(NR(RR[R�(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytget_reportable_changes7
scC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR(RR{R|R"R�RR[(RR`tkey((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.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(NR(RER"R!RR�R�RHR�R�R�RR[R�R�(RtdiffR�R`Rtchange((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRmC
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/virtual/{2}R�R�i�R�(R�R�R�RR"R�R�R�R�R�R�R�RR�(RR�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRcU
s


+c	C`s�td|jd|jd|jd|j�}|j�|jjdk	rttd�|j	D��stt
d��qtn|j�|jjr�t
S|j�t
S(NR#R�R!R"cs`s!|]}|dkr|VqdS(RfRgN(safmsasm((R	R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pys	<genexpr>k
ss?AFM must be provisioned to configure an IP Intelligence policy.(R R#R�R!R"R8R@R�R�R\RRqRjR�tcreate_on_device(RRl((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRdd
s'


cC`s|jj�}|jjr3t|jj|�}ndj|jj	d|jj	dt
|jj|jj��}|jj
j|d|�}y|j�}Wn%tk
r�}tt|���nXd|kr|dd	krd|kr�t|d��qt|j��ndS(
Ns'https://{0}:{1}/mgmt/tm/ltm/virtual/{2}R�R�R�R�i�i�R�(i�i�(R[t
api_paramsR"RYRR#tansible_versionR�R�R�RR�R�R�tpatchR�R�RR�R�(RRR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRkv
s 

cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd|d|j�S(	NsAhttps://{0}:{1}/mgmt/tm/ltm/virtual/{2}?expandSubcollections=trueR�R�R�i�R�RR�(R�R�R�RR"R�R�R�R�R�R�RR�R�R�(RR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRh�
s

cC`s|jj�}|jj|d<|jj|d<|jjrSt|jj|�}ndj	|j
jd|j
jd�}|j
jj
|d|�}y|j�}Wn%tk
r�}tt|���nXd|kr|ddkrd|krt|d��qt|j��ndS(
NR�R�s$https://{0}:{1}/mgmt/tm/ltm/virtual/R�R�R�R�i�i�i�R�(i�i�i�(R[RuR"R�R�RYRR#RvR�R�R�R�tpostR�R�RR�R�(RRR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRt�
s"
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns'https://{0}:{1}/mgmt/tm/ltm/virtual/{2}R�R�i�(
R�R�R�RR"R�R�R�tdeleteRR�RR�(RR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRn�
s

(R�R�R$RbRR_R�RiReRoRqRmRcRdRkRhRtRn(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRZ�s 															tArgumentSpeccB`seZd�ZRS(cTC`s�t|_tdtdddddddg�dtd	td
dg�dtd
d
dg�dt�dtddd
dgdtdt�dtddddddg���dtddd
dg�dtddd
dg�dtdd�dtdd�dt�d t�d!t�d"t�d#t�d$t�d%tdd&�d'tdd(d)td*gf�d+tdd,�d-tdd,�d.tdd/d0d1g�d2tdd3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEg�dtddFddFdGdHdIdJdKdLdMdNdOg
�dPtdd,�dQt�dRt�dSt�dTt�dUtdd�dVtddWdtdXt�dYtdd,�dZtdd,���d[tdd,dd\�d]tdd^�d_tdd^�d`tdd^�datddbdddcdddedbdfd$g�dgtdddtdhtd	t�dtd	tddidjg����#}i|_|jjt�|jj|�ddgg|_dS(kNR
tdefaultRtchoicesR_RNROR�trequiredtaliasestvsRMR�R�R^R*R_R�tall_profilestoptionsR�R�sserver-sidesclient-sideR,tall_policiesR.t	all_rulesR]R\RQRLR R$R"RRRPtrawR�tCommontfallbacktF5_PARTITIONR0tboolR2R>tpreservespreserve-strictRsR4RmR�RnRoRpRqRrRsRts	ipv6-auths
ipv6-crypts	ipv6-icmpsisp-ipRuRvRwRxRyRzR�s
forwarding-ips
forwarding-l2RYsmessage-routingsperformance-httpsperformance-l4RWRVR�RZR[R8R6R@R:R<R�R�RRRYRRBR�RFRHRDtobjectsobject-destinationsobject-source-destinationssource-destinations
object-sourceRJR�R�R�(R�tsupports_check_modeR�R	t
argument_specR�RR(RR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyR$�
s�				$																(R�R�R$(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyRz�
scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�RR#tmsg(RzRR�R�RRZRbt	exit_jsonRt	fail_jsonR�(tspecR#tmmR�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pytmain?s			t__main__(>t
__future__RRRR_t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRR�tansible.module_utils.basicRR	tansible.module_utils.sixR
tcollectionsRt%library.module_utils.network.f5.bigipRt&library.module_utils.network.f5.commonR
RRRRRRRRRt'library.module_utils.network.f5.compareRt)library.module_utils.network.f5.ipaddressRRRRRRt(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.icontrolRR�R�RRRR�R RERZRzR�R�(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_virtual_server.pyt<module>s�


����
���r��#ya���R�w	

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