Sieradzki, Lukasz 2024-11-08 23:02:23 +01:00
commit 2b35fbf404
3 changed files with 48 additions and 8 deletions

View file

@ -21,6 +21,13 @@
service_account_file: "{{ gcp_cred_file | default(omit) }}"
state: present
register: topic
- name: Create a bucket
google.cloud.gcp_storage_bucket:
name: topic-subscription-bucket
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
state: present
- name: Delete a subscription
google.cloud.gcp_pubsub_subscription:
name: "{{ resource_name }}"
@ -73,11 +80,20 @@
that:
- result.changed == false
#----------------------------------------------------------
- name: Update ack_deadline_seconds of a subscription that already exists
- name: Update cloudStorageConfig of a subscription that already exists
google.cloud.gcp_pubsub_subscription:
name: "{{ resource_name }}"
topic: "{{ topic }}"
ack_deadline_seconds: 500
ack_deadline_seconds: 300
cloud_storage: {
bucket: "topic-subscription-bucket",
file_prefix: "test_",
file_suffix: "_test",
max_bytes: 10737418240,
max_duration: "600s",
output_format: "avro",
write_metadata: true
}
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
@ -92,7 +108,7 @@
google.cloud.gcp_pubsub_subscription:
name: "{{ resource_name }}"
topic: "{{ topic }}"
ack_deadline_seconds: 500
ack_deadline_seconds: 300
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
@ -119,7 +135,7 @@
google.cloud.gcp_pubsub_subscription:
name: "{{ resource_name }}"
topic: "{{ topic }}"
ack_deadline_seconds: 500
ack_deadline_seconds: 300
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
@ -141,3 +157,11 @@
state: absent
register: topic
ignore_errors: true
- name: Delete a bucket
google.cloud.gcp_storage_bucket:
name: topic-subscription-bucket
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file | default(omit) }}"
state: absent