Bug fixes for gcp_pubsub_subscription (#42833)

This commit is contained in:
Alex Stephen 2018-08-13 09:14:11 -07:00
commit 32540c63de
2 changed files with 21 additions and 36 deletions

View file

@ -15,12 +15,10 @@
# Pre-test setup
- name: create a topic
gcp_pubsub_topic:
name: 'topic-subscription'
name: "topic-subscription"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
scopes:
- https://www.googleapis.com/auth/pubsub
state: present
register: topic
- name: delete a subscription
@ -28,13 +26,11 @@
name: "{{ resource_name }}"
topic: "{{ topic }}"
push_config:
push_endpoint: 'https://myapp.graphite.cloudnativeapp.com/webhook/sub1'
push_endpoint: https://myapp.graphite.cloudnativeapp.com/webhook/sub1
ack_deadline_seconds: 300
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 subscription
@ -42,13 +38,11 @@
name: "{{ resource_name }}"
topic: "{{ topic }}"
push_config:
push_endpoint: 'https://myapp.graphite.cloudnativeapp.com/webhook/sub1'
push_endpoint: https://myapp.graphite.cloudnativeapp.com/webhook/sub1
ack_deadline_seconds: 300
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
@ -69,13 +63,11 @@
name: "{{ resource_name }}"
topic: "{{ topic }}"
push_config:
push_endpoint: 'https://myapp.graphite.cloudnativeapp.com/webhook/sub1'
push_endpoint: https://myapp.graphite.cloudnativeapp.com/webhook/sub1
ack_deadline_seconds: 300
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
@ -88,13 +80,11 @@
name: "{{ resource_name }}"
topic: "{{ topic }}"
push_config:
push_endpoint: 'https://myapp.graphite.cloudnativeapp.com/webhook/sub1'
push_endpoint: https://myapp.graphite.cloudnativeapp.com/webhook/sub1
ack_deadline_seconds: 300
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
@ -117,13 +107,11 @@
name: "{{ resource_name }}"
topic: "{{ topic }}"
push_config:
push_endpoint: 'https://myapp.graphite.cloudnativeapp.com/webhook/sub1'
push_endpoint: https://myapp.graphite.cloudnativeapp.com/webhook/sub1
ack_deadline_seconds: 300
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
@ -134,11 +122,9 @@
# Post-test teardown
- name: delete a topic
gcp_pubsub_topic:
name: 'topic-subscription'
name: "topic-subscription"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
scopes:
- https://www.googleapis.com/auth/pubsub
state: absent
register: topic