mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Bug fixes for GCP modules (as of 2019-01-09T15:35:45-08:00) (#50786)
This commit is contained in:
@@ -44,13 +44,17 @@
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that instance was created
|
||||
shell: |
|
||||
gcloud spanner instances describe --project="{{ gcp_project }}" "{{ resource_name }}"
|
||||
gcp_spanner_instance_facts:
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/spanner.admin
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results.rc == 0
|
||||
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a instance that already exists
|
||||
gcp_spanner_instance:
|
||||
@@ -88,15 +92,17 @@
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that instance was deleted
|
||||
shell: |
|
||||
gcloud spanner instances describe --project="{{ gcp_project }}" "{{ resource_name }}"
|
||||
gcp_spanner_instance_facts:
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/spanner.admin
|
||||
register: results
|
||||
failed_when: results.rc == 0
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results.rc == 1
|
||||
- "\"Instance not found: projects/{{ gcp_project }}/instances/{{ resource_name }}\" in results.stderr"
|
||||
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a instance that does not exist
|
||||
gcp_spanner_instance:
|
||||
|
||||
Reference in New Issue
Block a user