From 580ae5cf0512b534f593372cb2eb4c4442b4ee8b Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Tue, 28 May 2019 22:26:51 +0000 Subject: [PATCH] Add support for INTERNAL_SELF_MANAGED backend service Signed-off-by: Modular Magician --- .../google/gcp_compute_backend_service.py | 18 ++++++++++++------ .../gcp_compute_backend_service_facts.py | 6 ++++-- .../gcp_compute_global_forwarding_rule.py | 3 ++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py b/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py index c9a636d55d3258..9a9d19f33d516c 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py @@ -33,7 +33,9 @@ description: - A Backend Service defines a group of virtual machines that will serve traffic for load balancing. This resource is a global backend service, appropriate for external - load balancing. For internal load balancing, use a regional backend service instead. + load balancing or self-managed internal load balancing. For managed internal load + balancing, use a regional backend service instead. +- Currently self-managed internal load balancing is only available in beta. short_description: Creates a GCP BackendService version_added: 2.6 author: Google Inc. (@googlecloudplatform) @@ -213,6 +215,8 @@ - The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. + - For internal load balancing, a URL to a HealthCheck resource must be specified + instead. required: true iap: description: @@ -237,9 +241,9 @@ description: - Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot - be used with the other. Must be `EXTERNAL` for a global backend service. Defaults - to `EXTERNAL`. - - 'Some valid choices include: "EXTERNAL"' + be used with the other. Must be `EXTERNAL` or `INTERNAL_SELF_MANAGED` for a + global backend service. Defaults to `EXTERNAL`. + - 'Some valid choices include: "EXTERNAL", "INTERNAL_SELF_MANAGED"' required: false default: EXTERNAL version_added: 2.7 @@ -515,6 +519,8 @@ - The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. + - For internal load balancing, a URL to a HealthCheck resource must be specified + instead. returned: success type: list id: @@ -552,8 +558,8 @@ description: - Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be - used with the other. Must be `EXTERNAL` for a global backend service. Defaults - to `EXTERNAL`. + used with the other. Must be `EXTERNAL` or `INTERNAL_SELF_MANAGED` for a global + backend service. Defaults to `EXTERNAL`. returned: success type: str name: diff --git a/lib/ansible/modules/cloud/google/gcp_compute_backend_service_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_backend_service_facts.py index 943e203be05c2f..a6fb0d6b0c2b1b 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_backend_service_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_backend_service_facts.py @@ -253,6 +253,8 @@ - The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required. + - For internal load balancing, a URL to a HealthCheck resource must be specified + instead. returned: success type: list id: @@ -290,8 +292,8 @@ description: - Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot - be used with the other. Must be `EXTERNAL` for a global backend service. Defaults - to `EXTERNAL`. + be used with the other. Must be `EXTERNAL` or `INTERNAL_SELF_MANAGED` for + a global backend service. Defaults to `EXTERNAL`. returned: success type: str name: diff --git a/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py b/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py index 6e139b51b4e8c6..c4b34c7d73c7d5 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule.py @@ -100,6 +100,7 @@ global forwarding rules cannot be used for INTERNAL load balancing.' - 'Some valid choices include: "INTERNAL_SELF_MANAGED", "EXTERNAL"' required: false + default: EXTERNAL name: description: - Name of the resource; provided by the client when the resource is created. The @@ -348,7 +349,7 @@ def main(): ip_address=dict(type='str'), ip_protocol=dict(type='str'), ip_version=dict(type='str'), - load_balancing_scheme=dict(type='str'), + load_balancing_scheme=dict(default='EXTERNAL', type='str'), name=dict(required=True, type='str'), network=dict(type='dict'), port_range=dict(type='str'),