mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-24 05:40:33 -07:00
Bug fixes for GCP modules (as of 2019-01-09T15:35:45-08:00) (#50786)
This commit is contained in:
parent
73abff2b5a
commit
899cc535cf
18 changed files with 142 additions and 119 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue