bigip_pool_member – Manages F5 BIG-IP LTM pool members

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


bigip_pool_member – Manages F5 BIG-IP LTM pool members

New in version 1.4.


Synopsis

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

Requirements

The below requirements are needed on the host that executes this module.

  • f5-sdk >= 3.0.16

Parameters

Parameter Choices/Defaults Comments

address

-

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

connection_limit

-

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

description

-

Pool member description.

fqdn

-

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.

This parameter is ignored when reuse_nodes is yes.

name

-

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

-

Default:

"Common"

Partition

password

- / 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

- / required

Pool name. This pool must exist.

port

- / 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

-

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

-

added in 2.5

Default:

null

A dict object containing connection details.

password

- / 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

- / required

The BIG-IP host.

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

server_port

-

Default:

443

The BIG-IP server port.

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

ssh_keyfile

-

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

-

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

- / required

  • rest
  • cli

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

user

- / 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

-

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

ratio

-

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

reuse_nodes

boolean

added in 2.6

  • no
  • yes

Reuses node definitions if requested.

server

- / required

The BIG-IP host.

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

server_port

-

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

- / required

  • present

  • absent
  • enabled
  • disabled
  • forced_offline

Pool member state.

user

- / 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 the f5-sdk Python package on the host. This is as easy as pip install f5-sdk.
  • 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:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: present
    pool: my-pool
    partition: Common
    host: "{{ ansible_default_ipv4['address'] }}"
    port: 80
    description: web server
    connection_limit: 100
    rate_limit: 50
    ratio: 2
  delegate_to: localhost

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

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

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

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

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

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




Status

Authors

  • Tim Rupp (@caphrim007)

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.7/modules/bigip_pool_member_module.html