community.general.gcp_healthcheck – Create, Update or Destroy a Healthcheck.¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.gcp_healthcheck
.
DEPRECATED¶
- Removed in
version 2.0.0
- Why
Updated modules released with increased functionality
- Alternative
Use google.cloud.gcp_compute_health_check, google.cloud.gcp_compute_http_health_check or google.cloud.gcp_compute_https_health_check instead.
Synopsis¶
Create, Update or Destroy a Healthcheck. Currently only HTTP and HTTPS Healthchecks are supported. Healthchecks are used to monitor individual instances, managed instance groups and/or backend services. Healtchecks are reusable.
Visit https://cloud.google.com/compute/docs/load-balancing/health-checks for an overview of Healthchecks on GCP.
See https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks for API details on HTTP Healthchecks.
See https://cloud.google.com/compute/docs/reference/latest/httpsHealthChecks for more details on the HTTPS Healtcheck API.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
google-api-python-client >= 1.6.2
google-auth >= 0.9.0
google-auth-httplib2 >= 0.0.2
Parameters¶
Parameter | Choices/Defaults | Comments |
---|---|---|
check_interval
integer
|
Default: 5
|
How often (in seconds) to send a health check.
|
credentials_file
string
|
Path to the JSON file associated with the service account email
|
|
healthcheck_name
string
/ required
|
Name of the Healthcheck.
|
|
healthcheck_type
string
/ required
|
|
Type of Healthcheck.
|
healthy_threshold
integer
|
Default: 2
|
A so-far unhealthy instance will be marked healthy after this many consecutive successes.
|
host_header
string
|
Default: ""
|
The value of the host header in the health check request. If left empty, the public IP on behalf of which this health check is performed will be used.
|
port
integer
|
The TCP port number for the health check request. The default value is 443 for HTTPS and 80 for HTTP.
|
|
project_id
string
|
Your GCP project ID
|
|
request_path
string
|
Default: "/"
|
The request path of the HTTPS health check request.
|
service_account_email
string
|
service account email
|
|
service_account_permissions
list
/ elements=string
|
service account permissions (see https://cloud.google.com/sdk/gcloud/reference/compute/instances/create, --scopes section for detailed information)
Available choices are:
bigquery , cloud-platform , compute-ro , compute-rw , useraccounts-ro , useraccounts-rw , datastore , logging-write , monitoring , sql-admin , storage-full , storage-ro , storage-rw , taskqueue , userinfo-email . |
|
state
string
|
|
State of the Healthcheck.
|
timeout
integer
|
Default: 5
|
How long (in seconds) to wait for a response before claiming failure. It is invalid for timeout to have a greater value than check_interval.
|
unhealthy_threshold
integer
|
Default: 2
|
A so-far healthy instance will be marked unhealthy after this many consecutive failures.
|
Examples¶
- name: Create Minimum HealthCheck
community.general.gcp_healthcheck:
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
healthcheck_name: my-healthcheck
healthcheck_type: HTTP
state: present
- name: Create HTTP HealthCheck
community.general.gcp_healthcheck:
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
healthcheck_name: my-healthcheck
healthcheck_type: HTTP
host: my-host
request_path: /hc
check_interval: 10
timeout: 30
unhealthy_threshhold: 2
healthy_threshhold: 1
state: present
- name: Create HTTPS HealthCheck
community.general.gcp_healthcheck:
service_account_email: "{{ service_account_email }}"
credentials_file: "{{ credentials_file }}"
project_id: "{{ project_id }}"
healthcheck_name: "{{ https_healthcheck }}"
healthcheck_type: HTTPS
host_header: my-host
request_path: /hc
check_interval: 5
timeout: 5
unhealthy_threshold: 2
healthy_threshold: 1
state: present
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
This module will be removed in version 2.0.0. [deprecated]
For more information see DEPRECATED.
Authors¶
Tom Melendez (@supertom) <tom@supertom.com>