community.digitalocean.digital_ocean_load_balancer module – Manage DigitalOcean Load Balancers
Note
This module is part of the community.digitalocean collection (version 1.22.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.digitalocean
.
To use it in a playbook, specify: community.digitalocean.digital_ocean_load_balancer
.
New in community.digitalocean 1.10.0
Synopsis
Manage DigitalOcean Load Balancers
Parameters
Parameter |
Comments |
---|---|
The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either Choices:
|
|
An array containing the IDs of the Droplets assigned to the load balancer. Required when creating load balancers. Mutually exclusive with tag, you can either define tag or droplet_ids but not both. |
|
A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Choices:
|
|
A boolean value indicating whether PROXY Protocol is in use. Choices:
|
|
An array of objects specifying the forwarding rules for a load balancer. Required when creating load balancers. Default: |
|
Certificate ID Default: |
|
Entry port Default: |
|
Entry protocol Default: |
|
Target port Default: |
|
Target protocol Default: |
|
TLS passthrough Choices:
|
|
An object specifying health check settings for the load balancer. Default: |
|
Check interval seconds Default: |
|
Healthy threshold Default: |
|
Path Default: |
|
Port Default: |
|
Protocol Default: |
|
Response timeout seconds Default: |
|
Unhealthy threshold Default: |
|
A human-readable name for a load balancer instance. Required and must be unique (current API documentation is not up-to-date for this parameter). |
|
DigitalOcean OAuth token; can be specified in |
|
Project to assign the resource to (project name, not UUID). Defaults to the default project of the account (empty string). Currently only supported when creating. Default: |
|
A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. Choices:
|
|
The slug identifier for the region where the resource will initially be available. Default: |
|
The size of the load balancer. The available sizes are You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. Choices:
|
|
The usual, Choices:
|
|
An object specifying sticky sessions settings for the load balancer. Default: |
|
Type Default: |
|
A tag associated with the droplets that you want to dynamically assign to the load balancer. Required when creating load balancers. Mutually exclusive with droplet_ids, you can either define tag or droplet_ids but not both. |
|
A string specifying the UUID of the VPC to which the load balancer is assigned. If unspecified, uses the default VPC in the region. |
|
Wait for the Load Balancer to be running before returning. Choices:
|
|
How long before wait gives up, in seconds, when creating a Load Balancer. Default: |
Examples
- name: Create a Load Balancer
community.digitalocean.digital_ocean_load_balancer:
state: present
name: test-loadbalancer-1
droplet_ids:
- 12345678
region: nyc1
forwarding_rules:
- entry_protocol: http
entry_port: 8080
target_protocol: http
target_port: 8080
certificate_id: ""
tls_passthrough: false
- name: Create a Load Balancer (and assign to Project "test")
community.digitalocean.digital_ocean_load_balancer:
state: present
name: test-loadbalancer-1
droplet_ids:
- 12345678
region: nyc1
forwarding_rules:
- entry_protocol: http
entry_port: 8080
target_protocol: http
target_port: 8080
certificate_id: ""
tls_passthrough: false
project: test
- name: Create a Load Balancer and associate it with a tag
community.digitalocean.digital_ocean_load_balancer:
state: present
name: test-loadbalancer-1
tag: test-tag
region: tor1
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Assignment status (ok, not_found, assigned, already_assigned, service_down) Returned: changed Sample: |
|
A DigitalOcean Load Balancer Returned: changed Sample: |
|
Informational or error message encountered during execution Returned: changed Sample: |
|
Resource assignment involved in project assignment Returned: changed Sample: |