Debian Codegraph @

ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_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_spanner_instance:
18 name: testinstance
19 display_name: My Spanner Instance
20 node_count: 2
21 labels:
22 cost_center: ti-1700004
23 config: regional-us-central1
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_spanner_instance:
31 name: testinstance
32 display_name: My Spanner Instance
33 node_count: 2
34 labels:
35 cost_center: ti-1700004
36 config: regional-us-central1
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_spanner_instance_info:
48 project: "{{ gcp_project }}"
49 auth_kind: "{{ gcp_cred_kind }}"
50 service_account_file: "{{ gcp_cred_file | default(omit) }}"
51 scopes:
52 - https://www.googleapis.com/auth/spanner.admin
53 register: results
54 - name: Verify that command succeeded
55 ansible.builtin.assert:
56 that:
57 - results['resources'] | map(attribute='name') | select("match", ".*testinstance.*") | list | length == 1
58 # ----------------------------------------------------------------------------
59 - name: Create a instance that already exists
60 google.cloud.gcp_spanner_instance:
61 name: testinstance
62 display_name: My Spanner Instance
63 node_count: 2
64 labels:
65 cost_center: ti-1700004
66 config: regional-us-central1
67 project: "{{ gcp_project }}"
68 auth_kind: "{{ gcp_cred_kind }}"
69 service_account_file: "{{ gcp_cred_file | default(omit) }}"
70 state: present
71 register: result
72 - name: Assert changed is false
73 ansible.builtin.assert:
74 that:
75 - result.changed == false
76 # ----------------------------------------------------------
77 - name: Delete a instance
78 google.cloud.gcp_spanner_instance:
79 name: testinstance
80 display_name: My Spanner Instance
81 node_count: 2
82 labels:
83 cost_center: ti-1700004
84 config: regional-us-central1
85 project: "{{ gcp_project }}"
86 auth_kind: "{{ gcp_cred_kind }}"
87 service_account_file: "{{ gcp_cred_file | default(omit) }}"
88 state: absent
89 register: result
90 - name: Assert changed is true
91 ansible.builtin.assert:
92 that:
93 - result.changed == true
94 - name: Verify that instance was deleted
95 google.cloud.gcp_spanner_instance_info:
96 project: "{{ gcp_project }}"
97 auth_kind: "{{ gcp_cred_kind }}"
98 service_account_file: "{{ gcp_cred_file | default(omit) }}"
99 scopes:
100 - https://www.googleapis.com/auth/spanner.admin
101 register: results
102 - name: Verify that command succeeded
103 ansible.builtin.assert:
104 that:
105 - results['resources'] | map(attribute='name') | select("match", ".*testinstance.*") | list | length == 0
106 # ----------------------------------------------------------------------------
107 - name: Delete a instance that does not exist
108 google.cloud.gcp_spanner_instance:
109 name: testinstance
110 display_name: My Spanner Instance
111 node_count: 2
112 labels:
113 cost_center: ti-1700004
114 config: regional-us-central1
115 project: "{{ gcp_project }}"
116 auth_kind: "{{ gcp_cred_kind }}"
117 service_account_file: "{{ gcp_cred_file | default(omit) }}"
118 state: absent
119 register: result
120 - name: Assert changed is false
121 ansible.builtin.assert:
122 that:
123 - result.changed == false