From e8e69bf069c99c644ade9915680505f2f12831b3 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 15 Mar 2019 12:43:12 -0700 Subject: [PATCH] Bug fixes for GCP modules (#53878) --- .../cloud/google/gcp_bigquery_dataset.py | 14 +- .../google/gcp_bigquery_dataset_facts.py | 9 +- .../cloud/google/gcp_bigquery_table.py | 34 +-- .../cloud/google/gcp_bigquery_table_facts.py | 11 +- .../cloud/google/gcp_cloudbuild_trigger.py | 53 ++-- .../google/gcp_cloudbuild_trigger_facts.py | 22 +- .../cloud/google/gcp_compute_address.py | 12 +- .../cloud/google/gcp_compute_address_facts.py | 15 +- .../google/gcp_compute_backend_bucket.py | 28 +- .../gcp_compute_backend_bucket_facts.py | 13 +- .../google/gcp_compute_backend_service.py | 64 ++--- .../gcp_compute_backend_service_facts.py | 13 +- .../modules/cloud/google/gcp_compute_disk.py | 62 +++-- .../cloud/google/gcp_compute_disk_facts.py | 24 +- .../cloud/google/gcp_compute_firewall.py | 30 +- .../google/gcp_compute_firewall_facts.py | 13 +- .../google/gcp_compute_forwarding_rule.py | 46 ++-- .../gcp_compute_forwarding_rule_facts.py | 15 +- .../google/gcp_compute_global_address.py | 12 +- .../gcp_compute_global_address_facts.py | 13 +- .../gcp_compute_global_forwarding_rule.py | 102 +++---- ...cp_compute_global_forwarding_rule_facts.py | 13 +- .../cloud/google/gcp_compute_health_check.py | 28 +- .../gcp_bigquery_dataset/tasks/main.yml | 70 ++--- .../targets/gcp_bigquery_table/tasks/main.yml | 128 ++++----- .../gcp_compute_address/tasks/main.yml | 60 ++-- .../gcp_compute_backend_bucket/tasks/main.yml | 100 +++---- .../tasks/main.yml | 160 +++++------ .../targets/gcp_compute_disk/tasks/main.yml | 90 +++--- .../gcp_compute_firewall/tasks/main.yml | 140 +++++----- .../tasks/main.yml | 148 +++++----- .../gcp_compute_global_address/tasks/main.yml | 50 ++-- .../tasks/main.yml | 258 +++++++++--------- .../gcp_compute_health_check/tasks/main.yml | 130 ++++----- 34 files changed, 1004 insertions(+), 976 deletions(-) diff --git a/lib/ansible/modules/cloud/google/gcp_bigquery_dataset.py b/lib/ansible/modules/cloud/google/gcp_bigquery_dataset.py index bdba1e07ca..96763d7202 100644 --- a/lib/ansible/modules/cloud/google/gcp_bigquery_dataset.py +++ b/lib/ansible/modules/cloud/google/gcp_bigquery_dataset.py @@ -148,13 +148,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_bigquery_dataset_facts.py b/lib/ansible/modules/cloud/google/gcp_bigquery_dataset_facts.py index 8c2e1e0e9e..ab5f7f3db8 100644 --- a/lib/ansible/modules/cloud/google/gcp_bigquery_dataset_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_bigquery_dataset_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a dataset facts +- name: " a dataset facts" gcp_bigquery_dataset_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_bigquery_table.py b/lib/ansible/modules/cloud/google/gcp_bigquery_table.py index 5e8c5b492f..502b0b3836 100644 --- a/lib/ansible/modules/cloud/google/gcp_bigquery_table.py +++ b/lib/ansible/modules/cloud/google/gcp_bigquery_table.py @@ -428,27 +428,27 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a dataset gcp_bigquery_dataset: - name: example_dataset - dataset_reference: - dataset_id: example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_dataset + dataset_reference: + dataset_id: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: dataset - name: create a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "test_project" - table_id: example_table - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: test_project + table_id: example_table + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_bigquery_table_facts.py b/lib/ansible/modules/cloud/google/gcp_bigquery_table_facts.py index c19ccb0c57..9aebcab67f 100644 --- a/lib/ansible/modules/cloud/google/gcp_bigquery_table_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_bigquery_table_facts.py @@ -48,12 +48,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a table facts +- name: " a table facts" gcp_bigquery_table_facts: - dataset: example_dataset - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + dataset: example_dataset + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger.py b/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger.py index c2b65b5995..f37e6b67bb 100644 --- a/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger.py +++ b/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger.py @@ -67,6 +67,7 @@ options: filename: description: - Path, from the source root, to a file whose contents is used for the template. + Either a filename or build template must be provided. required: false ignored_files: description: @@ -114,19 +115,23 @@ options: required: false branch_name: description: - - Name of the branch to build. + - Name of the branch to build. Exactly one a of branch name, tag, or commit + SHA must be provided. required: false tag_name: description: - - Name of the tag to build. + - Name of the tag to build. Exactly one of a branch name, tag, or commit SHA + must be provided. required: false commit_sha: description: - - Explicit commit SHA to build. + - Explicit commit SHA to build. Exactly one of a branch name, tag, or commit + SHA must be provided. required: false build: description: - - Contents of the build template. + - Contents of the build template. Either a filename or build template must be + provided. required: false suboptions: tags: @@ -184,23 +189,23 @@ notes: EXAMPLES = ''' - name: create a repository gcp_sourcerepo_repository: - name: projects/{{ gcp_project }}/repos/{{ resource_name }} - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: projects/{{ gcp_project }}/repos/{{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present - name: create a trigger gcp_cloudbuild_trigger: - trigger_template: - branch_name: master - project_id: "test_project" - repo_name: "test_object" - filename: cloudbuild.yaml - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + trigger_template: + branch_name: master + project_id: test_project + repo_name: test_object + filename: cloudbuild.yaml + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' @@ -233,6 +238,7 @@ substitutions: filename: description: - Path, from the source root, to a file whose contents is used for the template. + Either a filename or build template must be provided. returned: success type: str ignoredFiles: @@ -285,22 +291,25 @@ triggerTemplate: type: str branchName: description: - - Name of the branch to build. + - Name of the branch to build. Exactly one a of branch name, tag, or commit + SHA must be provided. returned: success type: str tagName: description: - - Name of the tag to build. + - Name of the tag to build. Exactly one of a branch name, tag, or commit SHA + must be provided. returned: success type: str commitSha: description: - - Explicit commit SHA to build. + - Explicit commit SHA to build. Exactly one of a branch name, tag, or commit + SHA must be provided. returned: success type: str build: description: - - Contents of the build template. + - Contents of the build template. Either a filename or build template must be provided. returned: success type: complex contains: diff --git a/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger_facts.py b/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger_facts.py index ee929ff194..ac40c6e7e7 100644 --- a/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_cloudbuild_trigger_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a trigger facts +- name: " a trigger facts" gcp_cloudbuild_trigger_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' @@ -86,6 +87,7 @@ items: filename: description: - Path, from the source root, to a file whose contents is used for the template. + Either a filename or build template must be provided. returned: success type: str ignoredFiles: @@ -141,22 +143,26 @@ items: type: str branchName: description: - - Name of the branch to build. + - Name of the branch to build. Exactly one a of branch name, tag, or commit + SHA must be provided. returned: success type: str tagName: description: - - Name of the tag to build. + - Name of the tag to build. Exactly one of a branch name, tag, or commit + SHA must be provided. returned: success type: str commitSha: description: - - Explicit commit SHA to build. + - Explicit commit SHA to build. Exactly one of a branch name, tag, or commit + SHA must be provided. returned: success type: str build: description: - - Contents of the build template. + - Contents of the build template. Either a filename or build template must be + provided. returned: success type: complex contains: diff --git a/lib/ansible/modules/cloud/google/gcp_compute_address.py b/lib/ansible/modules/cloud/google/gcp_compute_address.py index 6e2a6f1c78..1c2054a1b6 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_address.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_address.py @@ -121,12 +121,12 @@ notes: EXAMPLES = ''' - name: create a address gcp_compute_address: - name: test-address1 - region: us-west1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test-address1 + region: us-west1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_address_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_address_facts.py index 6eefbae74d..a6a3d67f1b 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_address_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_address_facts.py @@ -54,14 +54,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a address facts +- name: " a address facts" gcp_compute_address_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py b/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py index d13c8d1a22..d1bddb47c4 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py @@ -76,30 +76,30 @@ options: required: true extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/backendBuckets)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/backendBuckets)' - 'Using a Cloud Storage bucket as a load balancer backend: U(https://cloud.google.com/compute/docs/load-balancing/http/backend-bucket)' ''' EXAMPLES = ''' - name: create a bucket gcp_storage_bucket: - name: "bucket-backendbucket" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: bucket-backendbucket + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: bucket - name: create a backend bucket gcp_compute_backend_bucket: - name: "test_object" - bucket_name: "{{ bucket.name }}" - description: A BackendBucket to connect LNB w/ Storage Bucket - enable_cdn: true - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket_facts.py index 5588340851..fe21d60bdc 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_backend_bucket_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a backend bucket facts +- name: " a backend bucket facts" gcp_compute_backend_bucket_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' 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 508652ac3a..bab23b2994 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_backend_service.py @@ -229,10 +229,6 @@ options: description: - OAuth2 Client Secret for IAP. required: false - oauth2_client_secret_sha256: - description: - - OAuth2 Client Secret SHA-256 for IAP. - required: false load_balancing_scheme: description: - Indicates whether the backend service will be used with internal or external @@ -302,39 +298,39 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-backendservice" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-backendservice + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-backendservice" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-backendservice + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "test_object" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' @@ -655,15 +651,7 @@ def main(): description=dict(type='str'), enable_cdn=dict(type='bool'), health_checks=dict(type='list', elements='str'), - iap=dict( - type='dict', - options=dict( - enabled=dict(type='bool'), - oauth2_client_id=dict(type='str'), - oauth2_client_secret=dict(type='str'), - oauth2_client_secret_sha256=dict(type='str'), - ), - ), + iap=dict(type='dict', options=dict(enabled=dict(type='bool'), oauth2_client_id=dict(type='str'), oauth2_client_secret=dict(type='str'))), load_balancing_scheme=dict(type='str', choices=['INTERNAL', 'EXTERNAL']), name=dict(type='str'), port_name=dict(type='str'), 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 3abdd1f522..e9bbb3e6c6 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 @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a backend service facts +- name: " a backend service facts" gcp_compute_backend_service_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_disk.py b/lib/ansible/modules/cloud/google/gcp_compute_disk.py index e4da74189f..4c2c197f44 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_disk.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_disk.py @@ -89,6 +89,15 @@ options: of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. required: false + physical_block_size_bytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a request, + a default value is used. Currently supported sizes are 4096 and 16384, other + sizes may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + required: false + version_added: 2.8 type: description: - URL of the disk type resource describing which disk type to use to create the @@ -124,11 +133,6 @@ options: - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. required: false - sha256: - description: - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption - key that protects this resource. - required: false kms_key_name: description: - The name of the encryption key that is stored in Google Cloud KMS. @@ -150,11 +154,6 @@ options: - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. required: false - sha256: - description: - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption - key that protects this resource. - required: false kms_key_name: description: - The name of the encryption key that is stored in Google Cloud KMS. @@ -183,29 +182,24 @@ options: description: - The name of the encryption key that is stored in Google Cloud KMS. required: false - sha256: - description: - - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption - key that protects this resource. - required: false extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/disks)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/disks)' - 'Adding a persistent disk: U(https://cloud.google.com/compute/docs/disks/add-persistent-disk)' ''' EXAMPLES = ''' - name: create a disk gcp_compute_disk: - name: "test_object" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - zone: us-central1-a - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' @@ -277,6 +271,15 @@ users: .' returned: success type: list +physicalBlockSizeBytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a request, + a default value is used. Currently supported sizes are 4096 and 16384, other sizes + may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + returned: success + type: int type: description: - URL of the disk type resource describing which disk type to use to create the @@ -432,13 +435,14 @@ def main(): licenses=dict(type='list', elements='str'), name=dict(required=True, type='str'), size_gb=dict(type='int'), + physical_block_size_bytes=dict(type='int'), type=dict(type='str'), source_image=dict(type='str'), zone=dict(required=True, type='str'), - source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'), kms_key_name=dict(type='str'))), - disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'), kms_key_name=dict(type='str'))), + source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), + disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), source_snapshot=dict(), - source_snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'), sha256=dict(type='str'))), + source_snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), ) ) @@ -522,6 +526,7 @@ def resource_to_request(module): u'licenses': module.params.get('licenses'), u'name': module.params.get('name'), u'sizeGb': module.params.get('size_gb'), + u'physicalBlockSizeBytes': module.params.get('physical_block_size_bytes'), u'type': disk_type_selflink(module.params.get('type'), module.params), u'sourceImage': module.params.get('source_image'), } @@ -600,6 +605,7 @@ def response_to_hash(module, response): u'name': module.params.get('name'), u'sizeGb': response.get(u'sizeGb'), u'users': response.get(u'users'), + u'physicalBlockSizeBytes': response.get(u'physicalBlockSizeBytes'), u'type': response.get(u'type'), u'sourceImage': module.params.get('source_image'), } diff --git a/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py index 286ff33d3d..0eac0ae6d0 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_disk_facts.py @@ -53,14 +53,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a disk facts +- name: " a disk facts" gcp_compute_disk_facts: - zone: us-central1-a - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + zone: us-central1-a + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' @@ -137,6 +138,15 @@ items: .' returned: success type: list + physicalBlockSizeBytes: + description: + - Physical block size of the persistent disk, in bytes. If not present in a + request, a default value is used. Currently supported sizes are 4096 and 16384, + other sizes may be added in the future. + - If an unsupported value is requested, the error message will list the supported + values for the caller's project. + returned: success + type: int type: description: - URL of the disk type resource describing which disk type to use to create diff --git a/lib/ansible/modules/cloud/google/gcp_compute_firewall.py b/lib/ansible/modules/cloud/google/gcp_compute_firewall.py index ccecb4be77..ab70325e20 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_firewall.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_firewall.py @@ -214,27 +214,27 @@ options: required: false extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/firewalls)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/firewalls)' - 'Official Documentation: U(https://cloud.google.com/vpc/docs/firewalls)' ''' EXAMPLES = ''' - name: create a firewall gcp_compute_firewall: - name: "test_object" - allowed: - - ip_protocol: tcp - ports: - - '22' - target_tags: - - test-ssh-server - - staging-ssh-server - source_tags: - - test-ssh-clients - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_firewall_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_firewall_facts.py index 782236e4da..ecc39b5aac 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_firewall_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_firewall_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a firewall facts +- name: " a firewall facts" gcp_compute_firewall_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' 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 d18d954b07..c9eef469c4 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule.py @@ -205,43 +205,43 @@ options: required: true extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/forwardingRule)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/forwardingRule)' - 'Official Documentation: U(https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules)' ''' EXAMPLES = ''' - name: create a address gcp_compute_address: - name: "address-forwardingrule" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: address-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: address - name: create a target pool gcp_compute_target_pool: - name: "targetpool-forwardingrule" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: targetpool-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: targetpool - name: create a forwarding rule gcp_compute_forwarding_rule: - name: "test_object" - region: us-west1 - target: "{{ targetpool }}" - ip_protocol: TCP - port_range: 80-80 - ip_address: "{{ address.address }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' 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 c4dc80b55d..15cef1e1ce 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 @@ -54,14 +54,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a forwarding rule facts +- name: " a forwarding rule facts" gcp_compute_forwarding_rule_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_global_address.py b/lib/ansible/modules/cloud/google/gcp_compute_global_address.py index f597b111f0..8692981bd5 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_global_address.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_global_address.py @@ -88,18 +88,18 @@ options: - INTERNAL extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/globalAddresses)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/globalAddresses)' - 'Reserving a Static External IP Address: U(https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address)' ''' EXAMPLES = ''' - name: create a global address gcp_compute_global_address: - name: "test_object" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_global_address_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_global_address_facts.py index 4d5b895528..11682fee96 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_global_address_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_global_address_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a global address facts +- name: " a global address facts" gcp_compute_global_address_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' 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 9506472abe..2f4749a7f6 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 @@ -188,81 +188,81 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a global address gcp_compute_global_address: - name: "globaladdress-globalforwardingrule" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: globaladdress-globalforwardingrule + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: globaladdress - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-globalforwardingrule" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-globalforwardingrule + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-globalforwardingrule" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-globalforwardingrule + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-globalforwardingrule" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-globalforwardingrule + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a url map gcp_compute_url_map: - name: "urlmap-globalforwardingrule" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: urlmap-globalforwardingrule + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: urlmap - name: create a target http proxy gcp_compute_target_http_proxy: - name: "targethttpproxy-globalforwardingrule" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: targethttpproxy-globalforwardingrule + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: httpproxy - name: create a global forwarding rule gcp_compute_global_forwarding_rule: - name: "test_object" - ip_address: "{{ globaladdress.address }}" - ip_protocol: TCP - port_range: 80-80 - target: "{{ httpproxy.selfLink }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule_facts.py index 84f514404b..a9bc1652bb 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule_facts.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_global_forwarding_rule_facts.py @@ -49,13 +49,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a global forwarding rule facts +- name: " a global forwarding rule facts" gcp_compute_global_forwarding_rule_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/lib/ansible/modules/cloud/google/gcp_compute_health_check.py b/lib/ansible/modules/cloud/google/gcp_compute_health_check.py index 080caa2c83..1ecf29aa75 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_health_check.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_health_check.py @@ -264,26 +264,26 @@ options: - PROXY_V1 extends_documentation_fragment: gcp notes: -- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/latest/healthChecks)' +- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/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: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + 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: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/test/integration/targets/gcp_bigquery_dataset/tasks/main.yml b/test/integration/targets/gcp_bigquery_dataset/tasks/main.yml index db480b71f6..98421640d3 100644 --- a/test/integration/targets/gcp_bigquery_dataset/tasks/main.yml +++ b/test/integration/targets/gcp_bigquery_dataset/tasks/main.yml @@ -15,23 +15,23 @@ # Pre-test setup - name: delete a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -53,13 +53,13 @@ # ---------------------------------------------------------------------------- - name: create a dataset that already exists gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -69,13 +69,13 @@ #---------------------------------------------------------- - name: delete a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -97,13 +97,13 @@ # ---------------------------------------------------------------------------- - name: delete a dataset that does not exist gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_bigquery_table/tasks/main.yml b/test/integration/targets/gcp_bigquery_table/tasks/main.yml index c926621b48..3a1fda0ea5 100644 --- a/test/integration/targets/gcp_bigquery_table/tasks/main.yml +++ b/test/integration/targets/gcp_bigquery_table/tasks/main.yml @@ -15,39 +15,39 @@ # Pre-test setup - name: create a dataset gcp_bigquery_dataset: - name: example_dataset - dataset_reference: - dataset_id: example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_dataset + dataset_reference: + dataset_id: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: dataset - name: delete a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -70,16 +70,16 @@ # ---------------------------------------------------------------------------- - name: create a table that already exists gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -89,16 +89,16 @@ #---------------------------------------------------------- - name: delete a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -121,16 +121,16 @@ # ---------------------------------------------------------------------------- - name: delete a table that does not exist gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -142,12 +142,12 @@ # If errors happen, don't crash the playbook! - name: delete a dataset gcp_bigquery_dataset: - name: example_dataset - dataset_reference: - dataset_id: example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_dataset + dataset_reference: + dataset_id: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: dataset ignore_errors: true diff --git a/test/integration/targets/gcp_compute_address/tasks/main.yml b/test/integration/targets/gcp_compute_address/tasks/main.yml index 53eb5f345e..52b7c2357e 100644 --- a/test/integration/targets/gcp_compute_address/tasks/main.yml +++ b/test/integration/targets/gcp_compute_address/tasks/main.yml @@ -15,21 +15,21 @@ # Pre-test setup - name: delete a address gcp_compute_address: - name: test-address1 - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a address gcp_compute_address: - name: test-address1 - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -54,12 +54,12 @@ # ---------------------------------------------------------------------------- - name: create a address that already exists gcp_compute_address: - name: test-address1 - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -69,12 +69,12 @@ #---------------------------------------------------------- - name: delete a address gcp_compute_address: - name: test-address1 - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -99,12 +99,12 @@ # ---------------------------------------------------------------------------- - name: delete a address that does not exist gcp_compute_address: - name: test-address1 - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_compute_backend_bucket/tasks/main.yml b/test/integration/targets/gcp_compute_backend_bucket/tasks/main.yml index c7f53425d8..1074135754 100644 --- a/test/integration/targets/gcp_compute_backend_bucket/tasks/main.yml +++ b/test/integration/targets/gcp_compute_backend_bucket/tasks/main.yml @@ -15,33 +15,33 @@ # Pre-test setup - name: create a bucket gcp_storage_bucket: - name: "bucket-backendbucket" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: bucket-backendbucket + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: bucket - name: delete a backend bucket gcp_compute_backend_bucket: - name: "{{ resource_name }}" - bucket_name: "{{ bucket.name }}" - description: A BackendBucket to connect LNB w/ Storage Bucket - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a backend bucket gcp_compute_backend_bucket: - name: "{{ resource_name }}" - bucket_name: "{{ bucket.name }}" - description: A BackendBucket to connect LNB w/ Storage Bucket - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -65,14 +65,14 @@ # ---------------------------------------------------------------------------- - name: create a backend bucket that already exists gcp_compute_backend_bucket: - name: "{{ resource_name }}" - bucket_name: "{{ bucket.name }}" - description: A BackendBucket to connect LNB w/ Storage Bucket - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -82,14 +82,14 @@ #---------------------------------------------------------- - name: delete a backend bucket gcp_compute_backend_bucket: - name: "{{ resource_name }}" - bucket_name: "{{ bucket.name }}" - description: A BackendBucket to connect LNB w/ Storage Bucket - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -113,14 +113,14 @@ # ---------------------------------------------------------------------------- - name: delete a backend bucket that does not exist gcp_compute_backend_bucket: - name: "{{ resource_name }}" - bucket_name: "{{ bucket.name }}" - description: A BackendBucket to connect LNB w/ Storage Bucket - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -132,10 +132,10 @@ # If errors happen, don't crash the playbook! - name: delete a bucket gcp_storage_bucket: - name: "bucket-backendbucket" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: bucket-backendbucket + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: bucket ignore_errors: true diff --git a/test/integration/targets/gcp_compute_backend_service/tasks/main.yml b/test/integration/targets/gcp_compute_backend_service/tasks/main.yml index 3c73e06733..3bdf590fdd 100644 --- a/test/integration/targets/gcp_compute_backend_service/tasks/main.yml +++ b/test/integration/targets/gcp_compute_backend_service/tasks/main.yml @@ -15,50 +15,50 @@ # Pre-test setup - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-backendservice" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-backendservice + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-backendservice" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-backendservice + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: delete a backend service gcp_compute_backend_service: - name: "{{ resource_name }}" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a backend service gcp_compute_backend_service: - name: "{{ resource_name }}" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -82,16 +82,16 @@ # ---------------------------------------------------------------------------- - name: create a backend service that already exists gcp_compute_backend_service: - name: "{{ resource_name }}" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -101,16 +101,16 @@ #---------------------------------------------------------- - name: delete a backend service gcp_compute_backend_service: - name: "{{ resource_name }}" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -134,16 +134,16 @@ # ---------------------------------------------------------------------------- - name: delete a backend service that does not exist gcp_compute_backend_service: - name: "{{ resource_name }}" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -155,24 +155,24 @@ # If errors happen, don't crash the playbook! - name: delete a http health check gcp_compute_http_health_check: - name: "httphealthcheck-backendservice" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: httphealthcheck-backendservice + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: healthcheck ignore_errors: true - name: delete a instance group gcp_compute_instance_group: - name: "instancegroup-backendservice" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instancegroup-backendservice + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instancegroup ignore_errors: true diff --git a/test/integration/targets/gcp_compute_disk/tasks/main.yml b/test/integration/targets/gcp_compute_disk/tasks/main.yml index 572d567372..fc9e4dd6a0 100644 --- a/test/integration/targets/gcp_compute_disk/tasks/main.yml +++ b/test/integration/targets/gcp_compute_disk/tasks/main.yml @@ -15,27 +15,27 @@ # Pre-test setup - name: delete a disk gcp_compute_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a disk gcp_compute_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -60,15 +60,15 @@ # ---------------------------------------------------------------------------- - name: create a disk that already exists gcp_compute_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -78,15 +78,15 @@ #---------------------------------------------------------- - name: delete a disk gcp_compute_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -111,15 +111,15 @@ # ---------------------------------------------------------------------------- - name: delete a disk that does not exist gcp_compute_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_compute_firewall/tasks/main.yml b/test/integration/targets/gcp_compute_firewall/tasks/main.yml index 35ff0e4a1c..e88ffd7c6f 100644 --- a/test/integration/targets/gcp_compute_firewall/tasks/main.yml +++ b/test/integration/targets/gcp_compute_firewall/tasks/main.yml @@ -15,37 +15,37 @@ # Pre-test setup - name: delete a firewall gcp_compute_firewall: - name: "{{ resource_name }}" - allowed: - - ip_protocol: tcp - ports: - - '22' - target_tags: - - test-ssh-server - - staging-ssh-server - source_tags: - - test-ssh-clients - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a firewall gcp_compute_firewall: - name: "{{ resource_name }}" - allowed: - - ip_protocol: tcp - ports: - - '22' - target_tags: - - test-ssh-server - - staging-ssh-server - source_tags: - - test-ssh-clients - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -69,20 +69,20 @@ # ---------------------------------------------------------------------------- - name: create a firewall that already exists gcp_compute_firewall: - name: "{{ resource_name }}" - allowed: - - ip_protocol: tcp - ports: - - '22' - target_tags: - - test-ssh-server - - staging-ssh-server - source_tags: - - test-ssh-clients - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -92,20 +92,20 @@ #---------------------------------------------------------- - name: delete a firewall gcp_compute_firewall: - name: "{{ resource_name }}" - allowed: - - ip_protocol: tcp - ports: - - '22' - target_tags: - - test-ssh-server - - staging-ssh-server - source_tags: - - test-ssh-clients - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -129,20 +129,20 @@ # ---------------------------------------------------------------------------- - name: delete a firewall that does not exist gcp_compute_firewall: - name: "{{ resource_name }}" - allowed: - - ip_protocol: tcp - ports: - - '22' - target_tags: - - test-ssh-server - - staging-ssh-server - source_tags: - - test-ssh-clients - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml b/test/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml index a8b9bf36f3..58f6da4011 100644 --- a/test/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml +++ b/test/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml @@ -15,47 +15,47 @@ # Pre-test setup - name: create a address gcp_compute_address: - name: "address-forwardingrule" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: address-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: address - name: create a target pool gcp_compute_target_pool: - name: "targetpool-forwardingrule" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: targetpool-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: targetpool - name: delete a forwarding rule gcp_compute_forwarding_rule: - name: "{{ resource_name }}" - region: us-west1 - target: "{{ targetpool }}" - ip_protocol: TCP - port_range: 80-80 - ip_address: "{{ address.address }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a forwarding rule gcp_compute_forwarding_rule: - name: "{{ resource_name }}" - region: us-west1 - target: "{{ targetpool }}" - ip_protocol: TCP - port_range: 80-80 - ip_address: "{{ address.address }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -80,16 +80,16 @@ # ---------------------------------------------------------------------------- - name: create a forwarding rule that already exists gcp_compute_forwarding_rule: - name: "{{ resource_name }}" - region: us-west1 - target: "{{ targetpool }}" - ip_protocol: TCP - port_range: 80-80 - ip_address: "{{ address.address }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -99,16 +99,16 @@ #---------------------------------------------------------- - name: delete a forwarding rule gcp_compute_forwarding_rule: - name: "{{ resource_name }}" - region: us-west1 - target: "{{ targetpool }}" - ip_protocol: TCP - port_range: 80-80 - ip_address: "{{ address.address }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -133,16 +133,16 @@ # ---------------------------------------------------------------------------- - name: delete a forwarding rule that does not exist gcp_compute_forwarding_rule: - name: "{{ resource_name }}" - region: us-west1 - target: "{{ targetpool }}" - ip_protocol: TCP - port_range: 80-80 - ip_address: "{{ address.address }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -154,21 +154,21 @@ # If errors happen, don't crash the playbook! - name: delete a target pool gcp_compute_target_pool: - name: "targetpool-forwardingrule" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: targetpool-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: targetpool ignore_errors: true - name: delete a address gcp_compute_address: - name: "address-forwardingrule" - region: us-west1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: address-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: address ignore_errors: true diff --git a/test/integration/targets/gcp_compute_global_address/tasks/main.yml b/test/integration/targets/gcp_compute_global_address/tasks/main.yml index 7d35785e33..65940d4e18 100644 --- a/test/integration/targets/gcp_compute_global_address/tasks/main.yml +++ b/test/integration/targets/gcp_compute_global_address/tasks/main.yml @@ -15,19 +15,19 @@ # Pre-test setup - name: delete a global address gcp_compute_global_address: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a global address gcp_compute_global_address: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -51,11 +51,11 @@ # ---------------------------------------------------------------------------- - name: create a global address that already exists gcp_compute_global_address: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -65,11 +65,11 @@ #---------------------------------------------------------- - name: delete a global address gcp_compute_global_address: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -93,11 +93,11 @@ # ---------------------------------------------------------------------------- - name: delete a global address that does not exist gcp_compute_global_address: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/test/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml b/test/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml index e0a7c7af1c..ca63624843 100644 --- a/test/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml +++ b/test/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml @@ -15,87 +15,87 @@ # Pre-test setup - name: create a global address gcp_compute_global_address: - name: "globaladdress-globalforwardingrule" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: globaladdress-globalforwardingrule + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: globaladdress - name: create a instance group gcp_compute_instance_group: - name: "instancegroup-globalforwardingrule" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instancegroup-globalforwardingrule + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instancegroup - name: create a http health check gcp_compute_http_health_check: - name: "httphealthcheck-globalforwardingrule" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: httphealthcheck-globalforwardingrule + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: healthcheck - name: create a backend service gcp_compute_backend_service: - name: "backendservice-globalforwardingrule" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: backendservice-globalforwardingrule + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: backendservice - name: create a url map gcp_compute_url_map: - name: "urlmap-globalforwardingrule" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: urlmap-globalforwardingrule + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: urlmap - name: create a target http proxy gcp_compute_target_http_proxy: - name: "targethttpproxy-globalforwardingrule" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: targethttpproxy-globalforwardingrule + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: httpproxy - name: delete a global forwarding rule gcp_compute_global_forwarding_rule: - name: "{{ resource_name }}" - ip_address: "{{ globaladdress.address }}" - ip_protocol: TCP - port_range: 80-80 - target: "{{ httpproxy.selfLink }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a global forwarding rule gcp_compute_global_forwarding_rule: - name: "{{ resource_name }}" - ip_address: "{{ globaladdress.address }}" - ip_protocol: TCP - port_range: 80-80 - target: "{{ httpproxy.selfLink }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -119,15 +119,15 @@ # ---------------------------------------------------------------------------- - name: create a global forwarding rule that already exists gcp_compute_global_forwarding_rule: - name: "{{ resource_name }}" - ip_address: "{{ globaladdress.address }}" - ip_protocol: TCP - port_range: 80-80 - target: "{{ httpproxy.selfLink }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -137,15 +137,15 @@ #---------------------------------------------------------- - name: delete a global forwarding rule gcp_compute_global_forwarding_rule: - name: "{{ resource_name }}" - ip_address: "{{ globaladdress.address }}" - ip_protocol: TCP - port_range: 80-80 - target: "{{ httpproxy.selfLink }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -169,15 +169,15 @@ # ---------------------------------------------------------------------------- - name: delete a global forwarding rule that does not exist gcp_compute_global_forwarding_rule: - name: "{{ resource_name }}" - ip_address: "{{ globaladdress.address }}" - ip_protocol: TCP - port_range: 80-80 - target: "{{ httpproxy.selfLink }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -189,67 +189,67 @@ # If errors happen, don't crash the playbook! - name: delete a target http proxy gcp_compute_target_http_proxy: - name: "targethttpproxy-globalforwardingrule" - url_map: "{{ urlmap }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: targethttpproxy-globalforwardingrule + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: httpproxy ignore_errors: true - name: delete a url map gcp_compute_url_map: - name: "urlmap-globalforwardingrule" - default_service: "{{ backendservice }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: urlmap-globalforwardingrule + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: urlmap ignore_errors: true - name: delete a backend service gcp_compute_backend_service: - name: "backendservice-globalforwardingrule" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: backendservice-globalforwardingrule + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: backendservice ignore_errors: true - name: delete a http health check gcp_compute_http_health_check: - name: "httphealthcheck-globalforwardingrule" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: httphealthcheck-globalforwardingrule + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: healthcheck ignore_errors: true - name: delete a instance group gcp_compute_instance_group: - name: "instancegroup-globalforwardingrule" - zone: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instancegroup-globalforwardingrule + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instancegroup ignore_errors: true - name: delete a global address gcp_compute_global_address: - name: "globaladdress-globalforwardingrule" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: globaladdress-globalforwardingrule + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: globaladdress ignore_errors: true diff --git a/test/integration/targets/gcp_compute_health_check/tasks/main.yml b/test/integration/targets/gcp_compute_health_check/tasks/main.yml index 91c3977e12..833a2288eb 100644 --- a/test/integration/targets/gcp_compute_health_check/tasks/main.yml +++ b/test/integration/targets/gcp_compute_health_check/tasks/main.yml @@ -15,35 +15,35 @@ # Pre-test setup - name: delete a health check gcp_compute_health_check: - name: "{{ resource_name }}" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a health check gcp_compute_health_check: - name: "{{ resource_name }}" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -67,19 +67,19 @@ # ---------------------------------------------------------------------------- - name: create a health check that already exists gcp_compute_health_check: - name: "{{ resource_name }}" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -89,19 +89,19 @@ #---------------------------------------------------------- - name: delete a health check gcp_compute_health_check: - name: "{{ resource_name }}" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -125,19 +125,19 @@ # ---------------------------------------------------------------------------- - name: delete a health check that does not exist gcp_compute_health_check: - name: "{{ resource_name }}" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: