Bug fixes for GCP modules (as of 2019-01-09T15:35:45-08:00) (#50786)

This commit is contained in:
Alex Stephen 2019-01-16 09:58:57 -08:00
commit 899cc535cf
18 changed files with 142 additions and 119 deletions

View file

@ -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: