Documentation

bigip_pool - Manages F5 BIG-IP LTM pools

Synopsis

  • Manages F5 BIG-IP LTM pools via iControl REST API.

Requirements

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

  • f5-sdk >= 3.0.9

Parameters

Parameter
Choices/Defaults
Comments
description
(added in 2.3)
Specifies descriptive text that identifies the pool.
lb_method
(added in 1.3)
    Choices:
  • dynamic-ratio-member
  • dynamic-ratio-node
  • fastest-app-response
  • fastest-node
  • least-connections-member
  • least-connections-node
  • least-sessions
  • observed-member
  • observed-node
  • predictive-member
  • predictive-node
  • ratio-least-connections-member
  • ratio-least-connections-node
  • ratio-member
  • ratio-node
  • ratio-session
  • round-robin
  • weighted-least-connections-member
  • weighted-least-connections-nod
Load balancing method. When creating a new pool, if this value is not specified, the default of round-robin will be used.
metadata
(added in 2.5)
Arbitrary key/value pairs that you can attach to a pool. This is useful in situations where you might want to annotate a pool to me 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.
monitor_type
(added in 1.3)
    Choices:
  • and_list
  • m_of_n
  • single
Monitor rule type when monitors is specified.
When creating a new pool, if this value is not specified, the default of 'and_list' will be used.
When single ensures that all specified monitors are checked, but additionally includes checks to make sure you only specified a single monitor.
When and_list ensures that all monitors are checked.
When m_of_n ensures that quorum of monitors are checked. m_of_n requires that a quorum of 1 or greater be set either in the playbook, or already existing on the device.
Both single and and_list are functionally identical since BIG-IP considers all monitors as "a list".
monitors
(added in 1.3)
Monitor template name list. If the partition is not provided as part of the monitor name, then the partition option will be used instead.
name
required
Pool name

aliases: pool
partition
(added in 2.5)
Default:
Common
Device partition to manage resources on.
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
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.
quorum
(added in 1.3)
Monitor quorum value when monitor_type is m_of_n.
Quorum must be a value of 1 or greater when monitor_type is m_of_n.
reselect_tries
(added in 2.2)
Sets the number of times the system tries to contact a pool member after a passive failure.
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.
service_down_action
(added in 1.3)
    Choices:
  • none
  • reset
  • drop
  • reselect
Sets the action to take when node goes down in pool.
slow_ramp_time
(added in 1.3)
Sets the ramp-up time (in seconds) to gradually ramp up the load on newly added or freshly detected up pool members.
state
(added in 2.5)
    Choices:
  • absent
  • present ←
When present, guarantees that the pool exists with the provided attributes.
When absent, removes the pool from the system.
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 >= 12.
  • To add members do a pool, use the bigip_pool_member module. Previously, the bigip_pool module allowed the management of users, but this has been removed in version 2.5 of Ansible.
  • 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: Create pool
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: present
    name: my-pool
    partition: Common
    lb_method: least-connection-member
    slow_ramp_time: 120
  delegate_to: localhost

- name: Modify load balancer method
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: present
    name: my-pool
    partition: Common
    lb_method: round-robin
  delegate_to: localhost

- 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
  delegate_to: localhost

- name: Set a single monitor (with enforcement)
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: present
    name: my-pool
    partition: Common
    monitor_type: single
    monitors:
      - http
  delegate_to: localhost

- name: Set a single monitor (without enforcement)
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: present
    name: my-pool
    partition: Common
    monitors:
      - http
  delegate_to: localhost

- name: Set multiple monitors (all must succeed)
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: present
    name: my-pool
    partition: Common
    monitor_type: and_list
    monitors:
      - http
      - tcp
  delegate_to: localhost

- name: Set multiple monitors (at least 1 must succeed)
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: present
    name: my-pool
    partition: Common
    monitor_type: m_of_n
    quorum: 1
    monitors:
      - http
      - tcp
  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: Delete pool
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: absent
    name: my-pool
    partition: Common
  delegate_to: localhost

- name: Add metadata to pool
  bigip_pool:
    server: lb.mydomain.com
    user: admin
    password: secret
    state: absent
    name: my-pool
    partition: Common
    metadata:
      ansible: 2.4
      updated_at: 2017-12-20T17:50:46Z
  delegate_to: localhost

Return Values

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

Key
Returned
Description
description
string
changed
Description set on the pool.

Sample:
Pool of web servers
lb_method
string
changed
The LB method set for the pool.

Sample:
round-robin
metadata
dict
changed
The new value of the pool.

Sample:
{'key2': 'bar', 'key1': 'foo'}
monitor_type
string
changed
The contact that was set on the datacenter.

Sample:
admin@root.local
monitors
list
changed
Monitors set on the pool.

Sample:
['/Common/http', '/Common/gateway_icmp']
quorum
int
changed
The quorum that was set on the pool.

Sample:
2
reselect_tries
int
changed
The new value that is set for the number of tries to contact member.

Sample:
10
service_down_action
string
changed
Service down action that is set on the pool.

Sample:
reset
slow_ramp_time
int
changed
The new value that is set for the slow ramp-up time.

Sample:
500


Status

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

Author

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

Hint

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