mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Bug fixes for gcp_pubsub_topic (#42834)
This commit is contained in:
parent
87c6d4be57
commit
82678b9bac
2 changed files with 12 additions and 21 deletions
|
@ -56,12 +56,10 @@ extends_documentation_fragment: gcp
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: create a topic
|
- name: create a topic
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
name: 'test-topic1'
|
name: test-topic1
|
||||||
project: testProject
|
project: "test_project"
|
||||||
auth_kind: service_account
|
auth_kind: "service_account"
|
||||||
service_account_file: /tmp/auth.pem
|
service_account_file: "/tmp/auth.pem"
|
||||||
scopes:
|
|
||||||
- https://www.googleapis.com/auth/pubsub
|
|
||||||
state: present
|
state: present
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -95,6 +93,9 @@ def main():
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not module.params['scopes']:
|
||||||
|
module.params['scopes'] = ['https://www.googleapis.com/auth/pubsub']
|
||||||
|
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
|
|
||||||
fetch = fetch_resource(module, self_link(module))
|
fetch = fetch_resource(module, self_link(module))
|
||||||
|
|
|
@ -15,22 +15,18 @@
|
||||||
# Pre-test setup
|
# Pre-test setup
|
||||||
- name: delete a topic
|
- name: delete a topic
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
name: 'test-topic1'
|
name: test-topic1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
scopes:
|
|
||||||
- https://www.googleapis.com/auth/pubsub
|
|
||||||
state: absent
|
state: absent
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: create a topic
|
- name: create a topic
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
name: 'test-topic1'
|
name: test-topic1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
scopes:
|
|
||||||
- https://www.googleapis.com/auth/pubsub
|
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
|
@ -48,12 +44,10 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: create a topic that already exists
|
- name: create a topic that already exists
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
name: 'test-topic1'
|
name: test-topic1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
scopes:
|
|
||||||
- https://www.googleapis.com/auth/pubsub
|
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
|
@ -63,12 +57,10 @@
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
- name: delete a topic
|
- name: delete a topic
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
name: 'test-topic1'
|
name: test-topic1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
scopes:
|
|
||||||
- https://www.googleapis.com/auth/pubsub
|
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is true
|
- name: assert changed is true
|
||||||
|
@ -88,12 +80,10 @@
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
- name: delete a topic that does not exist
|
- name: delete a topic that does not exist
|
||||||
gcp_pubsub_topic:
|
gcp_pubsub_topic:
|
||||||
name: 'test-topic1'
|
name: test-topic1
|
||||||
project: "{{ gcp_project }}"
|
project: "{{ gcp_project }}"
|
||||||
auth_kind: "{{ gcp_cred_kind }}"
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
service_account_file: "{{ gcp_cred_file }}"
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
scopes:
|
|
||||||
- https://www.googleapis.com/auth/pubsub
|
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
- name: assert changed is false
|
- name: assert changed is false
|
||||||
|
|
Loading…
Reference in a new issue