diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py index f9fd45e04f7..c2b2e04949e 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py @@ -329,7 +329,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py index 12463218cf7..51e16a94b4d 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . extends_documentation_fragment: gcp diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py index 59efb92c5b1..02def517b03 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py @@ -371,7 +371,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py index 62c1c3fcc7a..c620ec05b8b 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . extends_documentation_fragment: gcp diff --git a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py index be3f9088849..f33349d0b97 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py @@ -486,7 +486,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py index 746448d60ca..0c6a4e52d59 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . region: diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py index 09aa92e3168..ec150e13d41 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py @@ -354,7 +354,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py index ea39b5241e4..b7f56b9c6f1 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . extends_documentation_fragment: gcp diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py index 725d790bc75..229d81a4d7a 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py @@ -481,7 +481,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py index d579b36412b..e68a89728d3 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . extends_documentation_fragment: gcp diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py b/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py index 5cecd07362c..89afc7701a1 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_pool.py @@ -421,7 +421,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py index 146495f7e8f..05332d6a112 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . region: diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py index 51476c6fa80..0e00b0b15b1 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py @@ -467,7 +467,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py index 4b6bc30312c..237ed188bfe 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . extends_documentation_fragment: gcp diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py index 0f522f27084..1a4679f713e 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py @@ -376,7 +376,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py index 2ffcedc028f..82c16cc1ab6 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . extends_documentation_fragment: gcp diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py index b2c263abf58..2ab6321c15b 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py @@ -334,7 +334,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py index 7d51d39761c..cdb59926501 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . region: diff --git a/lib/ansible/modules/cloud/google/gcp_compute_url_map.py b/lib/ansible/modules/cloud/google/gcp_compute_url_map.py index 76f3b61a879..4410306ffac 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_url_map.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_url_map.py @@ -556,7 +556,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py index 5957f67e9f9..11116766b7c 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . extends_documentation_fragment: gcp diff --git a/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py index ed644fef386..b01e884e967 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py @@ -470,7 +470,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri, 'compute#operation') + op_result = fetch_resource(module, op_uri, 'compute#operation', False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel_facts.py index 8c805236bd3..5ef29369bdf 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel_facts.py @@ -42,7 +42,7 @@ requirements: options: filters: description: - - A list of filter value pairs. Available filters are listed here U(U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).) + - A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.) - Each additional filter in the list will act be added as an AND condition (filter1 and filter2) . region: diff --git a/lib/ansible/modules/cloud/google/gcp_container_cluster.py b/lib/ansible/modules/cloud/google/gcp_container_cluster.py index 660aed70ab8..36e12dbbd45 100644 --- a/lib/ansible/modules/cloud/google/gcp_container_cluster.py +++ b/lib/ansible/modules/cloud/google/gcp_container_cluster.py @@ -49,7 +49,7 @@ options: default: present name: description: - - The name of this cluster. The name must be unique within this project and zone, + - The name of this cluster. The name must be unique within this project and location, and can be up to 40 characters. Must be Lowercase letters, numbers, and hyphens only. Must start with a letter. Must end with a number or a letter. required: false @@ -254,13 +254,11 @@ options: required: false location: description: - - The list of Google Compute Engine locations in which the cluster's nodes should - be located. - required: false - zone: - description: - - The zone where the cluster is deployed. + - The location where the cluster is deployed. required: true + aliases: + - zone + version_added: 2.8 extends_documentation_fragment: gcp ''' @@ -275,7 +273,7 @@ EXAMPLES = ''' node_config: machine_type: n1-standard-4 disk_size_gb: 500 - zone: us-central1-a + location: us-central1-a project: "test_project" auth_kind: "serviceaccount" service_account_file: "/tmp/auth.pem" @@ -285,7 +283,7 @@ EXAMPLES = ''' RETURN = ''' name: description: - - The name of this cluster. The name must be unique within this project and zone, + - The name of this cluster. The name must be unique within this project and location, and can be up to 40 characters. Must be Lowercase letters, numbers, and hyphens only. Must start with a letter. Must end with a number or a letter. returned: success @@ -508,12 +506,6 @@ subnetwork: - The name of the Google Compute Engine subnetwork to which the cluster is connected. returned: success type: str -location: - description: - - The list of Google Compute Engine locations in which the cluster's nodes should - be located. - returned: success - type: list endpoint: description: - The IP address of this cluster's master endpoint. @@ -567,9 +559,9 @@ expireTime: - The time the cluster will be automatically deleted in RFC3339 text format. returned: success type: str -zone: +location: description: - - The zone where the cluster is deployed. + - The location where the cluster is deployed. returned: success type: str ''' @@ -633,8 +625,7 @@ def main(): ), ), subnetwork=dict(type='str'), - location=dict(type='list', elements='str'), - zone=dict(required=True, type='str'), + location=dict(required=True, type='str', aliases=['zone']), ) ) @@ -696,7 +687,6 @@ def resource_to_request(module): u'clusterIpv4Cidr': module.params.get('cluster_ipv4_cidr'), u'addonsConfig': ClusterAddonsconfig(module.params.get('addons_config', {}), module).to_request(), u'subnetwork': module.params.get('subnetwork'), - u'location': module.params.get('location'), } request = encode_request(request, module) return_vals = {} @@ -713,11 +703,11 @@ def fetch_resource(module, link, allow_not_found=True): def self_link(module): - return "https://container.googleapis.com/v1/projects/{project}/zones/{zone}/clusters/{name}".format(**module.params) + return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters/{name}".format(**module.params) def collection(module): - return "https://container.googleapis.com/v1/projects/{project}/zones/{zone}/clusters".format(**module.params) + return "https://container.googleapis.com/v1/projects/{project}/locations/{location}/clusters".format(**module.params) def return_if_object(module, response, allow_not_found=False): @@ -774,7 +764,6 @@ def response_to_hash(module, response): u'clusterIpv4Cidr': response.get(u'clusterIpv4Cidr'), u'addonsConfig': ClusterAddonsconfig(response.get(u'addonsConfig', {}), module).from_response(), u'subnetwork': response.get(u'subnetwork'), - u'location': response.get(u'location'), u'endpoint': response.get(u'endpoint'), u'initialClusterVersion': response.get(u'initialClusterVersion'), u'currentMasterVersion': response.get(u'currentMasterVersion'), @@ -811,7 +800,7 @@ def wait_for_completion(status, op_result, module): while status != 'DONE': raise_if_errors(op_result, ['error', 'errors'], module) time.sleep(1.0) - op_result = fetch_resource(module, op_uri) + op_result = fetch_resource(module, op_uri, False) status = navigate_hash(op_result, ['status']) return op_result diff --git a/test/integration/targets/gcp_container_cluster/tasks/main.yml b/test/integration/targets/gcp_container_cluster/tasks/main.yml index 21ab8225612..1785c269452 100644 --- a/test/integration/targets/gcp_container_cluster/tasks/main.yml +++ b/test/integration/targets/gcp_container_cluster/tasks/main.yml @@ -23,7 +23,7 @@ node_config: machine_type: n1-standard-4 disk_size_gb: 500 - zone: us-central1-a + location: us-central1-a project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" service_account_file: "{{ gcp_cred_file }}" @@ -39,7 +39,7 @@ node_config: machine_type: n1-standard-4 disk_size_gb: 500 - zone: us-central1-a + location: us-central1-a project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" service_account_file: "{{ gcp_cred_file }}" @@ -51,7 +51,7 @@ - result.changed == true - name: verify that cluster was created gcp_container_cluster_facts: - zone: us-central1-a + location: us-central1-a project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" service_account_file: "{{ gcp_cred_file }}" @@ -73,7 +73,7 @@ node_config: machine_type: n1-standard-4 disk_size_gb: 500 - zone: us-central1-a + location: us-central1-a project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" service_account_file: "{{ gcp_cred_file }}" @@ -94,7 +94,7 @@ node_config: machine_type: n1-standard-4 disk_size_gb: 500 - zone: us-central1-a + location: us-central1-a project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" service_account_file: "{{ gcp_cred_file }}" @@ -106,7 +106,7 @@ - result.changed == true - name: verify that cluster was deleted gcp_container_cluster_facts: - zone: us-central1-a + location: us-central1-a project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" service_account_file: "{{ gcp_cred_file }}" @@ -128,7 +128,7 @@ node_config: machine_type: n1-standard-4 disk_size_gb: 500 - zone: us-central1-a + location: us-central1-a project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" service_account_file: "{{ gcp_cred_file }}"