From acaf91d5f092d586483c6d1c81748a58d167caf4 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 29 Mar 2019 10:09:01 -0700 Subject: [PATCH] Bug fixes for GCP modules (#54574) --- .../google/gcp_compute_forwarding_rule.py | 34 +++++++++++++++++++ .../gcp_compute_forwarding_rule_facts.py | 18 ++++++++++ 2 files changed, 52 insertions(+) diff --git a/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py b/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py index f7840a0990..7813b2b880 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py @@ -206,6 +206,18 @@ options: choices: - PREMIUM - STANDARD + service_label: + description: + - An optional prefix to the service name for this Forwarding Rule. + - If specified, will be the first label of the fully qualified service name. + - The label must be 1-63 characters long, and comply with RFC1035. + - Specifically, the label must be 1-63 characters long and match the regular expression + `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase + letter, and all following characters must be a dash, lowercase letter, or digit, + except the last character, which cannot be a dash. + - This field is only used for internal load balancing. + required: false + version_added: 2.8 region: description: - A reference to the region where the regional forwarding rule resides. @@ -396,6 +408,24 @@ networkTier: to be PREMIUM.' returned: success type: str +serviceLabel: + description: + - An optional prefix to the service name for this Forwarding Rule. + - If specified, will be the first label of the fully qualified service name. + - The label must be 1-63 characters long, and comply with RFC1035. + - Specifically, the label must be 1-63 characters long and match the regular expression + `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase + letter, and all following characters must be a dash, lowercase letter, or digit, + except the last character, which cannot be a dash. + - This field is only used for internal load balancing. + returned: success + type: str +serviceName: + description: + - The internal fully qualified service name for this Forwarding Rule. + - This field is only used for internal load balancing. + returned: success + type: str region: description: - A reference to the region where the regional forwarding rule resides. @@ -437,6 +467,7 @@ def main(): target=dict(), all_ports=dict(type='bool'), network_tier=dict(type='str', choices=['PREMIUM', 'STANDARD']), + service_label=dict(type='str'), region=dict(required=True, type='str'), ) ) @@ -517,6 +548,7 @@ def resource_to_request(module): u'target': replace_resource_dict(module.params.get(u'target', {}), 'selfLink'), u'allPorts': module.params.get('all_ports'), u'networkTier': module.params.get('network_tier'), + u'serviceLabel': module.params.get('service_label'), } return_vals = {} for k, v in request.items(): @@ -598,6 +630,8 @@ def response_to_hash(module, response): u'target': response.get(u'target'), u'allPorts': response.get(u'allPorts'), u'networkTier': module.params.get('network_tier'), + u'serviceLabel': response.get(u'serviceLabel'), + u'serviceName': response.get(u'serviceName'), } diff --git a/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule_facts.py index 7481e517a4..d0dce15b51 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule_facts.py @@ -216,6 +216,24 @@ items: it is assumed to be PREMIUM.' returned: success type: str + serviceLabel: + description: + - An optional prefix to the service name for this Forwarding Rule. + - If specified, will be the first label of the fully qualified service name. + - The label must be 1-63 characters long, and comply with RFC1035. + - Specifically, the label must be 1-63 characters long and match the regular + expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must + be a lowercase letter, and all following characters must be a dash, lowercase + letter, or digit, except the last character, which cannot be a dash. + - This field is only used for internal load balancing. + returned: success + type: str + serviceName: + description: + - The internal fully qualified service name for this Forwarding Rule. + - This field is only used for internal load balancing. + returned: success + type: str region: description: - A reference to the region where the regional forwarding rule resides.