Debian Codegraph @

ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/tasks/autogen.yml

raw symbols SCIP
1 ---
2 # ----------------------------------------------------------------------------
3 #
4 # *** AUTO GENERATED CODE *** Type: MMv1 ***
5 #
6 # ----------------------------------------------------------------------------
7 #
8 # This file is automatically generated by Magic Modules and manual
9 # changes will be clobbered when the file is regenerated.
10 #
11 # Please read more about how to change this file at
12 # https://www.github.com/GoogleCloudPlatform/magic-modules
13 #
14 # ----------------------------------------------------------------------------
15 # Pre-test setup
16 - name: Delete a topic
17 google.cloud.gcp_pubsub_topic:
18 name: test-topic1
19 project: "{{ gcp_project }}"
20 auth_kind: "{{ gcp_cred_kind }}"
21 service_account_file: "{{ gcp_cred_file | default(omit) }}"
22 state: absent
23 # ----------------------------------------------------------
24 - name: Create a topic
25 google.cloud.gcp_pubsub_topic:
26 name: test-topic1
27 project: "{{ gcp_project }}"
28 auth_kind: "{{ gcp_cred_kind }}"
29 service_account_file: "{{ gcp_cred_file | default(omit) }}"
30 state: present
31 register: result
32 - name: Assert changed is true
33 ansible.builtin.assert:
34 that:
35 - result.changed == true
36 - name: Verify that topic was created
37 google.cloud.gcp_pubsub_topic_info:
38 project: "{{ gcp_project }}"
39 auth_kind: "{{ gcp_cred_kind }}"
40 service_account_file: "{{ gcp_cred_file | default(omit) }}"
41 scopes:
42 - https://www.googleapis.com/auth/pubsub
43 register: results
44 - name: Verify that command succeeded
45 ansible.builtin.assert:
46 that:
47 - results['resources'] | map(attribute='name') | select("match", ".*test-topic1.*") | list | length == 1
48 # ----------------------------------------------------------------------------
49 - name: Create a topic that already exists
50 google.cloud.gcp_pubsub_topic:
51 name: test-topic1
52 project: "{{ gcp_project }}"
53 auth_kind: "{{ gcp_cred_kind }}"
54 service_account_file: "{{ gcp_cred_file | default(omit) }}"
55 state: present
56 register: result
57 - name: Assert changed is false
58 ansible.builtin.assert:
59 that:
60 - result.changed == false
61 # ----------------------------------------------------------
62 - name: Delete a topic
63 google.cloud.gcp_pubsub_topic:
64 name: test-topic1
65 project: "{{ gcp_project }}"
66 auth_kind: "{{ gcp_cred_kind }}"
67 service_account_file: "{{ gcp_cred_file | default(omit) }}"
68 state: absent
69 register: result
70 - name: Assert changed is true
71 ansible.builtin.assert:
72 that:
73 - result.changed == true
74 - name: Verify that topic was deleted
75 google.cloud.gcp_pubsub_topic_info:
76 project: "{{ gcp_project }}"
77 auth_kind: "{{ gcp_cred_kind }}"
78 service_account_file: "{{ gcp_cred_file | default(omit) }}"
79 scopes:
80 - https://www.googleapis.com/auth/pubsub
81 register: results
82 - name: Verify that command succeeded
83 ansible.builtin.assert:
84 that:
85 - results['resources'] | map(attribute='name') | select("match", ".*test-topic1.*") | list | length == 0
86 # ----------------------------------------------------------------------------
87 - name: Delete a topic that does not exist
88 google.cloud.gcp_pubsub_topic:
89 name: test-topic1
90 project: "{{ gcp_project }}"
91 auth_kind: "{{ gcp_cred_kind }}"
92 service_account_file: "{{ gcp_cred_file | default(omit) }}"
93 state: absent
94 register: result
95 - name: Assert changed is false
96 ansible.builtin.assert:
97 that:
98 - result.changed == false