|
|
|
@ -15,22 +15,18 @@
|
|
|
|
|
# Pre-test setup
|
|
|
|
|
- name: delete a topic
|
|
|
|
|
gcp_pubsub_topic:
|
|
|
|
|
name: 'test-topic1'
|
|
|
|
|
name: test-topic1
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/pubsub
|
|
|
|
|
state: absent
|
|
|
|
|
#----------------------------------------------------------
|
|
|
|
|
- name: create a topic
|
|
|
|
|
gcp_pubsub_topic:
|
|
|
|
|
name: 'test-topic1'
|
|
|
|
|
name: test-topic1
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/pubsub
|
|
|
|
|
state: present
|
|
|
|
|
register: result
|
|
|
|
|
- name: assert changed is true
|
|
|
|
@ -48,12 +44,10 @@
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
- name: create a topic that already exists
|
|
|
|
|
gcp_pubsub_topic:
|
|
|
|
|
name: 'test-topic1'
|
|
|
|
|
name: test-topic1
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/pubsub
|
|
|
|
|
state: present
|
|
|
|
|
register: result
|
|
|
|
|
- name: assert changed is false
|
|
|
|
@ -63,12 +57,10 @@
|
|
|
|
|
#----------------------------------------------------------
|
|
|
|
|
- name: delete a topic
|
|
|
|
|
gcp_pubsub_topic:
|
|
|
|
|
name: 'test-topic1'
|
|
|
|
|
name: test-topic1
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/pubsub
|
|
|
|
|
state: absent
|
|
|
|
|
register: result
|
|
|
|
|
- name: assert changed is true
|
|
|
|
@ -88,12 +80,10 @@
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
- name: delete a topic that does not exist
|
|
|
|
|
gcp_pubsub_topic:
|
|
|
|
|
name: 'test-topic1'
|
|
|
|
|
name: test-topic1
|
|
|
|
|
project: "{{ gcp_project }}"
|
|
|
|
|
auth_kind: "{{ gcp_cred_kind }}"
|
|
|
|
|
service_account_file: "{{ gcp_cred_file }}"
|
|
|
|
|
scopes:
|
|
|
|
|
- https://www.googleapis.com/auth/pubsub
|
|
|
|
|
state: absent
|
|
|
|
|
register: result
|
|
|
|
|
- name: assert changed is false
|
|
|
|
|