Documentation

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.

  • bigsuds
  • f5-sdk >= 3.0.9

Parameters

Parameter
Choices/Defaults
Comments
connection_limit
Pool member connection limit. Setting this to 0 disables the limit.
description
Pool member description.
host
required
Pool member IP.

aliases: address, name
monitor_state
(added in 2.0)
    Choices:
  • enabled
  • disabled
Set monitor availability status for pool member.
partition
Default:
Common
Partition
password
required
The password for the user account used to connect to the BIG-IP. You can omit this option if the environment variable F5_PASSWORD is set.

aliases: pass, pwd
pool
required
Pool name. This pool must exist.
port
required
Pool member port.
preserve_node
(added in 2.1)
    Choices:
  • yes
  • no ←
Default:
no
When state is absent and the pool member is no longer referenced in other pools, the default behavior removes the unused node o bject. 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)
A dict object containing connection details.
 
ssh_keyfile
Specifies the SSH keyfile to use to authenticate the connection to the remote device. This argument is only used for cli transports. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead.
 
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.
 
server
required
The BIG-IP host. You can omit this option if the environment variable F5_SERVER is set.
 
user
required
The username to connect to the BIG-IP with. This user must have administrative privileges on the device. You can omit this option if the environment variable F5_USER is set.
 
server_port
Default:
443
The BIG-IP server port. You can omit this option if the environment variable F5_SERVER_PORT is set.
 
password
required
The password for the user account used to connect to the BIG-IP. You can omit this option if the environment variable F5_PASSWORD is set.

aliases: pass, pwd
 
validate_certs
    Choices:
  • no
  • yes ←
If no, SSL certificates will not be validated. Use this only on personally controlled sites using self-signed certificates. You can omit this option if the environment variable F5_VALIDATE_CERTS is set.
 
transport
required
    Choices:
  • rest
  • cli ←
Configures the transport connection to use when connecting to the remote device.
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.
server
required
The BIG-IP host. You can omit this option if the environment variable F5_SERVER is set.
server_port
(added in 2.2)
Default:
443
The BIG-IP server port. You can omit this option if the environment variable F5_SERVER_PORT is set.
session_state
(added in 2.0)
    Choices:
  • enabled
  • disabled
Set new session availability status for pool member.
state
required
    Choices:
  • present ←
  • absent
Pool member state.
user
required
The username to connect to the BIG-IP with. This user must have administrative privileges on the device. You can omit this option if the environment variable F5_USER is set.
validate_certs
(added in 2.0)
    Choices:
  • no
  • yes ←
If no, SSL certificates will not be validated. Use this only on personally controlled sites using self-signed certificates. You can omit this option if the environment variable F5_VALIDATE_CERTS is set.

Notes

Note

  • Requires BIG-IP software version >= 11
  • F5 developed module ‘bigsuds’ required (see http://devcentral.f5.com)
  • Best run as a local_action in your playbook
  • Supersedes bigip_pool for managing pool members
  • 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.

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


# The BIG-IP GUI doesn't map directly to the API calls for "Pool ->
# Members -> State". The following states map to API monitor
# and session states.
#
# Enabled (all traffic allowed):
# monitor_state=enabled, session_state=enabled
# Disabled (only persistent or active connections allowed):
# monitor_state=enabled, session_state=disabled
# Forced offline (only active connections allowed):
# monitor_state=disabled, session_state=disabled
#
# See https://devcentral.f5.com/questions/icontrol-equivalent-call-for-b-node-down

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

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Author

  • Matt Hite (@mhite)
  • Tim Rupp (@caphrim007)

Hint

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