- Docs »
- gcp_backend_service - Create or Destroy a Backend Service.
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
gcp_backend_service - Create or Destroy a Backend Service.
The below requirements are needed on the host that executes this module.
- python >= 2.6
- apache-libcloud >= 1.3.0
Parameter |
Choices/Defaults |
Comments |
backend_service_name
required |
|
Name of the Backend Service.
|
backends
required |
|
|
credentials_file
|
|
Path to the JSON file associated with the service account email.
|
enable_cdn
|
|
If true, enable Cloud CDN for this Backend Service.
|
healthchecks
required |
|
List of healthchecks. Only one healthcheck is supported.
|
port_name
|
|
Name of the port on the managed instance group (MIG) that backend services can forward data to. Required for external load balancing.
|
project_id
|
|
GCE project ID.
|
protocol
|
|
The protocol this Backend Service uses to communicate with backends. Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP.
|
service_account_email
|
|
Service account email
|
state
|
Choices:
- absent
present ←
|
Desired state of the resource
|
timeout
|
|
How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. Valid range is 1-86400.
|
Note
- Update is not currently supported.
- Only global backend services are currently supported. Regional backends not currently supported.
- Internal load balancing not currently supported.
- name: Create Minimum Backend Service
gcp_backend_service:
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
backend_service_name: "{{ bes }}"
backends:
- instance_group: managed_instance_group_1
healthchecks:
- name: healthcheck_name_for_backend_service
port_name: myhttpport
state: present
- name: Create BES with extended backend parameters
gcp_backend_service:
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
backend_service_name: "{{ bes }}"
backends:
- instance_group: managed_instance_group_1
max_utilization: 0.6
max_rate: 10
- instance_group: managed_instance_group_2
max_utilization: 0.5
max_rate: 4
healthchecks:
- name: healthcheck_name_for_backend_service
port_name: myhttpport
state: present
timeout: 60
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
backend_service_created
boolean
|
When a Backend Service is created. |
Indicator Backend Service was created.
Sample:
True
|
backend_service_deleted
boolean
|
When a Backend Service is deleted. |
Indicator Backend Service was deleted.
Sample:
True
|
backend_service_name
string
|
Always. |
Name of the Backend Service.
Sample:
my-backend-service
|
backends
list
|
When a Backend Service exists. |
List of backends (comprised of instance_group) that make up a Backend Service.
Sample:
[ { 'instance_group': 'mig_one', 'zone': 'us-central1-b'} ]
|
enable_cdn
boolean
|
When a backend service exists. |
If Cloud CDN is enabled. null if not set.
Sample:
True
|
healthchecks
list
|
When a Backend Service exists. |
List of healthchecks applied to the Backend Service.
Sample:
[ 'my-healthcheck' ]
|
port_name
string
|
When a Backend Service exists. |
Name of Backend Port.
Sample:
myhttpport
|
protocol
string
|
When a Backend Service exists. |
Protocol used to communicate with the Backends.
Sample:
HTTP
|
timeout
int
|
If specified. |
In seconds, how long before a request sent to a backend is considered failed.
Sample:
myhttpport
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.