mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 04:10:27 -07:00
Minor updates to HealthCheck description, default values. (#78)
This commit is contained in:
parent
5533497c8d
commit
01734b6279
1 changed files with 199 additions and 75 deletions
|
@ -31,15 +31,15 @@ DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: gcp_compute_health_check
|
module: gcp_compute_health_check
|
||||||
description:
|
description:
|
||||||
- Health Checks determine whether instances are responsive and able to do work.
|
- Health Checks determine whether instances are responsive and able to do work.
|
||||||
- They are an important part of a comprehensive load balancing configuration, as they
|
- They are an important part of a comprehensive load balancing configuration, as they
|
||||||
enable monitoring instances behind load balancers.
|
enable monitoring instances behind load balancers.
|
||||||
- Health Checks poll instances at a specified interval. Instances that do not respond
|
- Health Checks poll instances at a specified interval. Instances that do not respond
|
||||||
successfully to some number of probes in a row are marked as unhealthy. No new connections
|
successfully to some number of probes in a row are marked as unhealthy. No new connections
|
||||||
are sent to unhealthy instances, though existing connections will continue. The
|
are sent to unhealthy instances, though existing connections will continue. The
|
||||||
health check will continue to poll unhealthy instances. If an instance later responds
|
health check will continue to poll unhealthy instances. If an instance later responds
|
||||||
successfully to some number of consecutive probes, it is marked healthy again and
|
successfully to some number of consecutive probes, it is marked healthy again and
|
||||||
can receive new connections.
|
can receive new connections.
|
||||||
short_description: Creates a GCP HealthCheck
|
short_description: Creates a GCP HealthCheck
|
||||||
version_added: 2.6
|
version_added: 2.6
|
||||||
author: Google Inc. (@googlecloudplatform)
|
author: Google Inc. (@googlecloudplatform)
|
||||||
|
@ -122,14 +122,17 @@ options:
|
||||||
- The request path of the HTTP health check request.
|
- The request path of the HTTP health check request.
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
required: false
|
required: false
|
||||||
default: "/"
|
default: 2
|
||||||
response:
|
name:
|
||||||
description:
|
description:
|
||||||
- The bytes to match against the beginning of the response data. If left empty
|
- Name of the resource. Provided by the client when the resource is created. The name
|
||||||
(the default value), any response will indicate health. The response data
|
must be 1-63 characters long, and comply with RFC1035. Specifically, the name must
|
||||||
can only be ASCII.
|
be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
|
||||||
required: false
|
which means the first character must be a lowercase letter, and all following characters
|
||||||
port:
|
must be a dash, lowercase letter, or digit, except the last character, which cannot
|
||||||
|
be a dash.
|
||||||
|
required: true
|
||||||
|
timeout_sec:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTP health check request.
|
- The TCP port number for the HTTP health check request.
|
||||||
- The default value is 80.
|
- The default value is 80.
|
||||||
|
@ -144,39 +147,175 @@ options:
|
||||||
- Specifies the type of proxy header to append before sending data to the
|
- Specifies the type of proxy header to append before sending data to the
|
||||||
backend, either NONE or PROXY_V1. The default is NONE.
|
backend, either NONE or PROXY_V1. The default is NONE.
|
||||||
required: false
|
required: false
|
||||||
default: NONE
|
choices: ['TCP', 'SSL', 'HTTP', 'HTTPS']
|
||||||
choices:
|
http_health_check:
|
||||||
- NONE
|
|
||||||
- PROXY_V1
|
|
||||||
https_health_check:
|
|
||||||
description:
|
|
||||||
- A nested object resource.
|
|
||||||
required: false
|
|
||||||
suboptions:
|
|
||||||
host:
|
|
||||||
description:
|
description:
|
||||||
- The value of the host header in the HTTPS health check request.
|
- The value of the host header in the HTTPS health check request.
|
||||||
- If left empty (default value), the public IP on behalf of which this health
|
- If left empty (default value), the public IP on behalf of which this health
|
||||||
check is performed will be used.
|
check is performed will be used.
|
||||||
required: false
|
required: false
|
||||||
request_path:
|
suboptions:
|
||||||
|
host:
|
||||||
|
description:
|
||||||
|
- The value of the host header in the HTTP health check request.
|
||||||
|
- If left empty (default value), the public IP on behalf of which this health check
|
||||||
|
is performed will be used.
|
||||||
|
required: false
|
||||||
|
request_path:
|
||||||
|
description:
|
||||||
|
- The request path of the HTTP health check request.
|
||||||
|
- The default value is /.
|
||||||
|
required: false
|
||||||
|
default: /
|
||||||
|
port:
|
||||||
|
description:
|
||||||
|
- The TCP port number for the HTTP health check request.
|
||||||
|
- The default value is 80.
|
||||||
|
required: false
|
||||||
|
port_name:
|
||||||
|
description:
|
||||||
|
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
|
||||||
|
are defined, port takes precedence.
|
||||||
|
required: false
|
||||||
|
proxy_header:
|
||||||
|
description:
|
||||||
|
- Specifies the type of proxy header to append before sending data to the backend,
|
||||||
|
either NONE or PROXY_V1. The default is NONE.
|
||||||
|
required: false
|
||||||
|
default: NONE
|
||||||
|
choices: ['NONE', 'PROXY_V1']
|
||||||
|
https_health_check:
|
||||||
description:
|
description:
|
||||||
- The request path of the HTTPS health check request.
|
- The request path of the HTTPS health check request.
|
||||||
- The default value is /.
|
- The default value is /.
|
||||||
required: false
|
required: false
|
||||||
default: "/"
|
suboptions:
|
||||||
response:
|
host:
|
||||||
|
description:
|
||||||
|
- The value of the host header in the HTTPS health check request.
|
||||||
|
- If left empty (default value), the public IP on behalf of which this health check
|
||||||
|
is performed will be used.
|
||||||
|
required: false
|
||||||
|
request_path:
|
||||||
|
description:
|
||||||
|
- The request path of the HTTPS health check request.
|
||||||
|
- The default value is /.
|
||||||
|
required: false
|
||||||
|
default: /
|
||||||
|
port:
|
||||||
|
description:
|
||||||
|
- The TCP port number for the HTTPS health check request.
|
||||||
|
- The default value is 443.
|
||||||
|
required: false
|
||||||
|
port_name:
|
||||||
|
description:
|
||||||
|
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
|
||||||
|
are defined, port takes precedence.
|
||||||
|
required: false
|
||||||
|
proxy_header:
|
||||||
|
description:
|
||||||
|
- Specifies the type of proxy header to append before sending data to the backend,
|
||||||
|
either NONE or PROXY_V1. The default is NONE.
|
||||||
|
required: false
|
||||||
|
default: NONE
|
||||||
|
choices: ['NONE', 'PROXY_V1']
|
||||||
|
tcp_health_check:
|
||||||
description:
|
description:
|
||||||
- The bytes to match against the beginning of the response data. If left empty
|
- The bytes to match against the beginning of the response data. If left empty
|
||||||
(the default value), any response will indicate health. The response data
|
(the default value), any response will indicate health. The response data
|
||||||
can only be ASCII.
|
can only be ASCII.
|
||||||
required: false
|
required: false
|
||||||
port:
|
suboptions:
|
||||||
|
request:
|
||||||
|
description:
|
||||||
|
- The application data to send once the TCP connection has been established (default
|
||||||
|
value is empty). If both request and response are empty, the connection establishment
|
||||||
|
alone will indicate health. The request data can only be ASCII.
|
||||||
|
required: false
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left empty (the
|
||||||
|
default value), any response will indicate health. The response data can only be
|
||||||
|
ASCII.
|
||||||
|
required: false
|
||||||
|
port:
|
||||||
|
description:
|
||||||
|
- The TCP port number for the TCP health check request.
|
||||||
|
- The default value is 443.
|
||||||
|
required: false
|
||||||
|
port_name:
|
||||||
|
description:
|
||||||
|
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
|
||||||
|
are defined, port takes precedence.
|
||||||
|
required: false
|
||||||
|
proxy_header:
|
||||||
|
description:
|
||||||
|
- Specifies the type of proxy header to append before sending data to the backend,
|
||||||
|
either NONE or PROXY_V1. The default is NONE.
|
||||||
|
required: false
|
||||||
|
default: NONE
|
||||||
|
choices: ['NONE', 'PROXY_V1']
|
||||||
|
ssl_health_check:
|
||||||
description:
|
description:
|
||||||
- The TCP port number for the HTTPS health check request.
|
- The TCP port number for the HTTPS health check request.
|
||||||
- The default value is 443.
|
- The default value is 443.
|
||||||
required: false
|
required: false
|
||||||
port_name:
|
suboptions:
|
||||||
|
request:
|
||||||
|
description:
|
||||||
|
- The application data to send once the SSL connection has been established (default
|
||||||
|
value is empty). If both request and response are empty, the connection establishment
|
||||||
|
alone will indicate health. The request data can only be ASCII.
|
||||||
|
required: false
|
||||||
|
response:
|
||||||
|
description:
|
||||||
|
- The bytes to match against the beginning of the response data. If left empty (the
|
||||||
|
default value), any response will indicate health. The response data can only be
|
||||||
|
ASCII.
|
||||||
|
required: false
|
||||||
|
port:
|
||||||
|
description:
|
||||||
|
- The TCP port number for the SSL health check request.
|
||||||
|
- The default value is 443.
|
||||||
|
required: false
|
||||||
|
port_name:
|
||||||
|
description:
|
||||||
|
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
|
||||||
|
are defined, port takes precedence.
|
||||||
|
required: false
|
||||||
|
proxy_header:
|
||||||
|
description:
|
||||||
|
- Specifies the type of proxy header to append before sending data to the backend,
|
||||||
|
either NONE or PROXY_V1. The default is NONE.
|
||||||
|
required: false
|
||||||
|
default: NONE
|
||||||
|
choices: ['NONE', 'PROXY_V1']
|
||||||
|
extends_documentation_fragment: gcp
|
||||||
|
notes:
|
||||||
|
- "API Reference: U(https://cloud.google.com/compute/docs/reference/rest/latest/healthChecks)"
|
||||||
|
- "Official Documentation: U(https://cloud.google.com/load-balancing/docs/health-checks)"
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: create a health check
|
||||||
|
gcp_compute_health_check:
|
||||||
|
name: "test_object"
|
||||||
|
type: TCP
|
||||||
|
tcp_health_check:
|
||||||
|
port_name: service-health
|
||||||
|
request: ping
|
||||||
|
response: pong
|
||||||
|
healthy_threshold: 10
|
||||||
|
timeout_sec: 2
|
||||||
|
unhealthy_threshold: 5
|
||||||
|
project: "test_project"
|
||||||
|
auth_kind: "service_account"
|
||||||
|
service_account_file: "/tmp/auth.pem"
|
||||||
|
state: present
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
check_interval_sec:
|
||||||
description:
|
description:
|
||||||
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
|
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
|
||||||
are defined, port takes precedence.
|
are defined, port takes precedence.
|
||||||
|
@ -536,50 +675,35 @@ def main():
|
||||||
timeout_sec=dict(default=5, type='int', aliases=['timeout_seconds']),
|
timeout_sec=dict(default=5, type='int', aliases=['timeout_seconds']),
|
||||||
unhealthy_threshold=dict(default=2, type='int'),
|
unhealthy_threshold=dict(default=2, type='int'),
|
||||||
type=dict(type='str', choices=['TCP', 'SSL', 'HTTP', 'HTTPS']),
|
type=dict(type='str', choices=['TCP', 'SSL', 'HTTP', 'HTTPS']),
|
||||||
http_health_check=dict(
|
http_health_check=dict(type='dict', options=dict(
|
||||||
type='dict',
|
host=dict(type='str'),
|
||||||
options=dict(
|
request_path=dict(default='/', type='str'),
|
||||||
host=dict(type='str'),
|
port=dict(type='int'),
|
||||||
request_path=dict(default='/', type='str'),
|
port_name=dict(type='str'),
|
||||||
response=dict(type='str'),
|
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
||||||
port=dict(type='int'),
|
)),
|
||||||
port_name=dict(type='str'),
|
https_health_check=dict(type='dict', options=dict(
|
||||||
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1']),
|
host=dict(type='str'),
|
||||||
),
|
request_path=dict(default='/', type='str'),
|
||||||
),
|
port=dict(type='int'),
|
||||||
https_health_check=dict(
|
port_name=dict(type='str'),
|
||||||
type='dict',
|
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
||||||
options=dict(
|
)),
|
||||||
host=dict(type='str'),
|
tcp_health_check=dict(type='dict', options=dict(
|
||||||
request_path=dict(default='/', type='str'),
|
request=dict(type='str'),
|
||||||
response=dict(type='str'),
|
response=dict(type='str'),
|
||||||
port=dict(type='int'),
|
port=dict(type='int'),
|
||||||
port_name=dict(type='str'),
|
port_name=dict(type='str'),
|
||||||
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1']),
|
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
||||||
),
|
)),
|
||||||
),
|
ssl_health_check=dict(type='dict', options=dict(
|
||||||
tcp_health_check=dict(
|
request=dict(type='str'),
|
||||||
type='dict',
|
response=dict(type='str'),
|
||||||
options=dict(
|
port=dict(type='int'),
|
||||||
request=dict(type='str'),
|
port_name=dict(type='str'),
|
||||||
response=dict(type='str'),
|
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1'])
|
||||||
port=dict(type='int'),
|
))
|
||||||
port_name=dict(type='str'),
|
)
|
||||||
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1']),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ssl_health_check=dict(
|
|
||||||
type='dict',
|
|
||||||
options=dict(
|
|
||||||
request=dict(type='str'),
|
|
||||||
response=dict(type='str'),
|
|
||||||
port=dict(type='int'),
|
|
||||||
port_name=dict(type='str'),
|
|
||||||
proxy_header=dict(default='NONE', type='str', choices=['NONE', 'PROXY_V1']),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
mutually_exclusive=[['http_health_check', 'https_health_check', 'ssl_health_check', 'tcp_health_check']],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if not module.params['scopes']:
|
if not module.params['scopes']:
|
||||||
|
|
Loading…
Add table
Reference in a new issue