community.general.gcp_backend_service – Create or Destroy a Backend Service.
Note
This plugin is part of the community.general collection (version 1.3.2).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.gcp_backend_service
.
DEPRECATED
- Removed in
-
version 2.0.0
- Why
-
Updated modules released with increased functionality
- Alternative
-
Use google.cloud.gcp_compute_backend_service instead.
Synopsis
- Create or Destroy a Backend Service. See https://cloud.google.com/compute/docs/load-balancing/http/backend-service for an overview. Full install/configuration instructions for the Google Cloud modules can be found in the comments of ansible/test/gce_tests.py.
Requirements
The below requirements are needed on the host that executes this module.
- python >= 2.6
- apache-libcloud >= 1.3.0
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
backend_service_name string / required | Name of the Backend Service. | |
backends list / elements=string / required | List of backends that make up the backend service. A backend is made up of an instance group and optionally several other parameters. See https://cloud.google.com/compute/docs/reference/latest/backendServices for details. | |
credentials_file string | Path to the JSON file associated with the service account email. | |
enable_cdn boolean |
| If true, enable Cloud CDN for this Backend Service. |
healthchecks list / elements=string / required | List of healthchecks. Only one healthcheck is supported. | |
pem_file string | Path to the PEM file associated with the service account email. | |
port_name string | Name of the port on the managed instance group (MIG) that backend services can forward data to. Required for external load balancing. | |
project_id string | GCE project ID. | |
protocol string |
| The protocol this Backend Service uses to communicate with backends. Possible values are HTTP, HTTPS, TCP, and SSL. The default is TCP. |
service_account_email string | Service account email | |
service_account_permissions list / elements=string | service account permissions | |
state string |
| Desired state of the resource |
timeout integer | How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. Valid range is 1-86400. |
Notes
Note
- Update is not currently supported.
- Only global backend services are currently supported. Regional backends not currently supported.
- Internal load balancing not currently supported.
Examples
- name: Create Minimum Backend Service community.general.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: - healthcheck_name_for_backend_service port_name: myhttpport state: present - name: Create BES with extended backend parameters community.general.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: - healthcheck_name_for_backend_service port_name: myhttpport state: present timeout: 60
Return Values
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 / elements=string | 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 / elements=string | 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 integer | If specified. | In seconds, how long before a request sent to a backend is considered failed. Sample: myhttpport |
Status
- This module will be removed in version 2.0.0. [deprecated]
- For more information see DEPRECATED.
Authors
- Tom Melendez (@supertom) <tom@supertom.com>
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/gcp_backend_service_module.html