bigip_pool_member – Manages F5 BIG-IP LTM pool members

From Get docs
Ansible/docs/2.8/modules/bigip pool member module


bigip_pool_member – Manages F5 BIG-IP LTM pool members

Synopsis

  • Manages F5 BIG-IP LTM pool members via iControl SOAP API.

Parameters

Parameter Choices/Defaults Comments

address

string

added in 2.2

IP address of the pool member. This can be either IPv4 or IPv6. When creating a new pool member, one of either address or fqdn must be provided. This parameter cannot be updated after it is set.


aliases: ip, host

aggregate

list

added in 2.8

List of pool member definitions to be created, modified or removed.


aliases: members

availability_requirements

dictionary

added in 2.8

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 none value will remove any health monitoring from the member completely.

at_least

integer

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 type of at_least is used.

This parameter will be ignored if a type of all is used.

type

string

  • all
  • at_least

Monitor rule type when monitors is specified.

When creating a new pool, if this value is not specified, the default of 'all' will be used.

connection_limit

integer

Pool member connection limit. Setting this to 0 disables the limit.

description

string

Pool member description.

fqdn

string

added in 2.6

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. host.domain.

FQDN names must end with a letter or a number.

When creating a new pool member, one of either address or fqdn must be provided. This parameter cannot be updated after it is set.


aliases: hostname

fqdn_auto_populate

boolean

added in 2.6

  • no
  • yes

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 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 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 yes.

Once set this parameter cannot be changed afterwards.

This parameter is ignored when reuse_nodes is yes.

ip_encapsulation

string

added in 2.8

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 none, disables IP encapsulation.

When inherit, inherits IP encapsulation setting from the member's pool.

When any other value, Options are None, Inherit from Pool, and Member Specific.

monitors

list

added in 2.8

Specifies the health monitors that the system currently uses to monitor this resource.

name

string

added in 2.6

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 address or fqdn.

The enabled state is an alias of present.

partition

string

Default:

"Common"

Partition to manage resources on.

password

string / required

The password for the user account used to connect to the BIG-IP.

You may omit this option by setting the environment variable F5_PASSWORD.


aliases: pass, pwd

pool

string / required

Pool name. This pool must exist.

port

integer / required

Pool member port.

This value cannot be changed after it has been set.

preserve_node

boolean

added in 2.1

  • no
  • yes

When state is 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 yes disables this behavior.

priority_group

integer

added in 2.5

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.

provider

dictionary

added in 2.5

A dict object containing connection details.

password

string / required

The password for the user account used to connect to the BIG-IP.

You may omit this option by setting the environment variable F5_PASSWORD.


aliases: pass, pwd

server

string / required

The BIG-IP host.

You may omit this option by setting the environment variable F5_SERVER.

server_port

integer

Default:

443

The BIG-IP server port.

You may omit this option by setting the environment variable F5_SERVER_PORT.

ssh_keyfile

path

Specifies the SSH keyfile to use to authenticate the connection to the remote device. This argument is only used for cli transports.

You may omit this option by setting the environment variable ANSIBLE_NET_SSH_KEYFILE.

timeout

integer

Default:

10

Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error.

transport

string

  • cli
  • rest

Configures the transport connection to use when connecting to the remote device.

user

string / required

The username to connect to the BIG-IP with. This user must have administrative privileges on the device.

You may omit this option by setting the environment variable F5_USER.

validate_certs

boolean

  • no
  • yes

If no, SSL certificates are not validated. Use this only on personally controlled sites using self-signed certificates.

You may omit this option by setting the environment variable F5_VALIDATE_CERTS.

rate_limit

integer

Pool member rate limit (connections-per-second). Setting this to 0 disables the limit.

ratio

integer

Pool member ratio weight. Valid values range from 1 through 100. New pool members -- unless overridden with this value -- default to 1.

replace_all_with

boolean

added in 2.8

  • no

  • yes

Remove members not defined in the aggregate parameter.

This operation is all or none, meaning that it will stop if there are some pool members that cannot be removed.


aliases: purge

reuse_nodes

boolean

added in 2.6

  • no
  • yes

Reuses node definitions if requested.

server

string / required

The BIG-IP host.

You may omit this option by setting the environment variable F5_SERVER.

server_port

integer

added in 2.2

Default:

443

The BIG-IP server port.

You may omit this option by setting the environment variable F5_SERVER_PORT.

state

string / required

  • present

  • absent
  • enabled
  • disabled
  • forced_offline

Pool member state.

user

string / required

The username to connect to the BIG-IP with. This user must have administrative privileges on the device.

You may omit this option by setting the environment variable F5_USER.

validate_certs

boolean

added in 2.0

  • no
  • yes

If no, SSL certificates are not validated. Use this only on personally controlled sites using self-signed certificates.

You may omit this option by setting the environment variable F5_VALIDATE_CERTS.



Notes

Note

  • For more information on using Ansible to manage F5 Networks devices see https://www.ansible.com/integrations/networks/f5.
  • Requires BIG-IP software version >= 12.
  • The F5 modules only manipulate the running configuration of the F5 product. To ensure that BIG-IP specific configuration persists to disk, be sure to include at least one task that uses the bigip_config module to save the running configuration. Refer to the module’s documentation for the correct usage of the module to save your running configuration.


Examples

- 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

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description

address

string

changed

The address of the pool member.


Sample:

1.2.3.4

connection_limit

integer

changed

The new connection limit of the pool member


Sample:

1000

description

string

changed

The new description of pool member.


Sample:

My pool member

fqdn

string

changed

The FQDN of the pool member.


Sample:

foo.bar.com

fqdn_auto_populate

boolean

changed

Whether FQDN auto population was set on the member or not.


Sample:

True

monitors

list

changed

The new list of monitors for the resource.


Sample:

['/Common/monitor1', '/Common/monitor2']

priority_group

integer

changed

The new priority group.


Sample:

3

rate_limit

integer

changed

The new rate limit, in connections per second, of the pool member.


Sample:

100

ratio

integer

changed

The new pool member ratio weight.


Sample:

50

replace_all_with

boolean

changed

Purges all non-aggregate pool members from device


Sample:

True




Status

Authors

  • Tim Rupp (@caphrim007)
  • Wojciech Wypior (@wojtek0806)

Hint

If you notice any issues in this documentation you can edit this document to improve it.


© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.8/modules/bigip_pool_member_module.html