mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-24 13:50:30 -07:00
Pubsub + DNS Facts (#75)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
cec7d597fc
commit
2a6c1e408e
29 changed files with 366 additions and 315 deletions
|
@ -51,8 +51,10 @@
|
|||
- result.changed == true
|
||||
- name: verify that node_pool was created
|
||||
gcp_container_node_pool_facts:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
cluster: "{{ cluster }}"
|
||||
location: us-central1-a
|
||||
zone: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
|
@ -97,8 +99,10 @@
|
|||
- result.changed == true
|
||||
- name: verify that node_pool was deleted
|
||||
gcp_container_node_pool_facts:
|
||||
filters:
|
||||
- name = {{ resource_name }}
|
||||
cluster: "{{ cluster }}"
|
||||
location: us-central1-a
|
||||
zone: us-central1-a
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
|
|
|
@ -56,6 +56,19 @@
|
|||
that:
|
||||
- result.changed == true
|
||||
- "result.kind == 'dns#resourceRecordSet'"
|
||||
- name: verify that resource_record_set was created
|
||||
gcp_dns_resource_record_set_facts:
|
||||
managed_zone: "{{ managed_zone }}"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/ndev.clouddns.readwrite
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 2
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a resource record set that already exists
|
||||
gcp_dns_resource_record_set:
|
||||
|
@ -96,6 +109,19 @@
|
|||
that:
|
||||
- result.changed == true
|
||||
- result.has_key('kind') == False
|
||||
- name: verify that resource_record_set was deleted
|
||||
gcp_dns_resource_record_set_facts:
|
||||
managed_zone: "{{ managed_zone }}"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/ndev.clouddns.readwrite
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['items'] | length >= 2
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a resource record set that does not exist
|
||||
gcp_dns_resource_record_set:
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
- results['items'] | length == 1
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a subscription that already exists
|
||||
gcp_pubsub_subscription:
|
||||
|
@ -98,7 +98,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
- results['items'] | length == 0
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a subscription that does not exist
|
||||
gcp_pubsub_subscription:
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- "'test-topic1' in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
- results['items'] | length == 1
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a topic that already exists
|
||||
gcp_pubsub_topic:
|
||||
|
@ -82,7 +82,7 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- "'test-topic1' not in \"{{ results['items'] | map(attribute='name') | list }}\""
|
||||
- results['items'] | length == 0
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a topic that does not exist
|
||||
gcp_pubsub_topic:
|
||||
|
|
|
@ -57,6 +57,8 @@
|
|||
- "result.kind == 'sql#user'"
|
||||
- name: verify that user was created
|
||||
gcp_sql_user_facts:
|
||||
filters:
|
||||
- name = test-user
|
||||
instance: "{{ instance }}"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
@ -104,6 +106,8 @@
|
|||
- result.has_key('kind') == False
|
||||
- name: verify that user was deleted
|
||||
gcp_sql_user_facts:
|
||||
filters:
|
||||
- name = test-user
|
||||
instance: "{{ instance }}"
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue