Debian Codegraph @

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

raw
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 instance
17 google.cloud.gcp_bigtable_instance:
18 name: my-instance
19 display_name: My Test Cluster
20 clusters:
21 - name: mycluster
22 location: projects/{{ gcp_project }}/locations/us-central1-a
23 serve_nodes: 1
24 project: "{{ gcp_project }}"
25 auth_kind: "{{ gcp_cred_kind }}"
26 service_account_file: "{{ gcp_cred_file | default(omit) }}"
27 state: absent
28 # ----------------------------------------------------------
29 - name: Create a instance
30 google.cloud.gcp_bigtable_instance:
31 name: my-instance
32 display_name: My Test Cluster
33 clusters:
34 - name: mycluster
35 location: projects/{{ gcp_project }}/locations/us-central1-a
36 serve_nodes: 1
37 project: "{{ gcp_project }}"
38 auth_kind: "{{ gcp_cred_kind }}"
39 service_account_file: "{{ gcp_cred_file | default(omit) }}"
40 state: present
41 register: result
42 - name: Assert changed is true
43 ansible.builtin.assert:
44 that:
45 - result.changed == true
46 - name: Verify that instance was created
47 google.cloud.gcp_bigtable_instance_info:
48 project: "{{ gcp_project }}"
49 auth_kind: "{{ gcp_cred_kind }}"
50 service_account_file: "{{ gcp_cred_file | default(omit) }}"
51 register: results
52 - name: Verify that command succeeded
53 ansible.builtin.assert:
54 that:
55 - results['resources'] | map(attribute='name') | select("match", ".*my-instance.*") | list | length == 1
56 # ----------------------------------------------------------------------------
57 - name: Create a instance that already exists
58 google.cloud.gcp_bigtable_instance:
59 name: my-instance
60 display_name: My Test Cluster
61 clusters:
62 - name: mycluster
63 location: projects/{{ gcp_project }}/locations/us-central1-a
64 serve_nodes: 1
65 project: "{{ gcp_project }}"
66 auth_kind: "{{ gcp_cred_kind }}"
67 service_account_file: "{{ gcp_cred_file | default(omit) }}"
68 state: present
69 register: result
70 - name: Assert changed is false
71 ansible.builtin.assert:
72 that:
73 - result.changed == false
74 # ----------------------------------------------------------
75 - name: Delete a instance
76 google.cloud.gcp_bigtable_instance:
77 name: my-instance
78 display_name: My Test Cluster
79 clusters:
80 - name: mycluster
81 location: projects/{{ gcp_project }}/locations/us-central1-a
82 serve_nodes: 1
83 project: "{{ gcp_project }}"
84 auth_kind: "{{ gcp_cred_kind }}"
85 service_account_file: "{{ gcp_cred_file | default(omit) }}"
86 state: absent
87 register: result
88 - name: Assert changed is true
89 ansible.builtin.assert:
90 that:
91 - result.changed == true
92 - name: Verify that instance was deleted
93 google.cloud.gcp_bigtable_instance_info:
94 project: "{{ gcp_project }}"
95 auth_kind: "{{ gcp_cred_kind }}"
96 service_account_file: "{{ gcp_cred_file | default(omit) }}"
97 register: results
98 - name: Verify that command succeeded
99 ansible.builtin.assert:
100 that:
101 - results['resources'] | map(attribute='name') | select("match", ".*my-instance.*") | list | length == 0
102 # ----------------------------------------------------------------------------
103 - name: Delete a instance that does not exist
104 google.cloud.gcp_bigtable_instance:
105 name: my-instance
106 display_name: My Test Cluster
107 clusters:
108 - name: mycluster
109 location: projects/{{ gcp_project }}/locations/us-central1-a
110 serve_nodes: 1
111 project: "{{ gcp_project }}"
112 auth_kind: "{{ gcp_cred_kind }}"
113 service_account_file: "{{ gcp_cred_file | default(omit) }}"
114 state: absent
115 register: result
116 - name: Assert changed is false
117 ansible.builtin.assert:
118 that:
119 - result.changed == false