|
1 | 1 | --- |
2 | 2 | - name: setup |
3 | | - cs_domain: |
| 3 | + ngine_io.cloudstack.domain: |
4 | 4 | path: "{{ cs_resource_prefix }}_domain" |
5 | 5 | state: absent |
6 | 6 | register: dom |
7 | 7 | - name: verify setup |
8 | 8 | assert: |
9 | 9 | that: |
10 | | - - dom is successful |
| 10 | + - dom is successful |
11 | 11 |
|
12 | 12 | - name: test fail if missing name |
13 | 13 | action: cs_domain |
|
16 | 16 | - name: verify results of fail if missing params |
17 | 17 | assert: |
18 | 18 | that: |
19 | | - - dom is failed |
20 | | - - 'dom.msg == "missing required arguments: path"' |
| 19 | + - dom is failed |
| 20 | + - 'dom.msg == "missing required arguments: path"' |
21 | 21 |
|
22 | 22 | - name: test fail if ends with / |
23 | | - cs_domain: |
| 23 | + ngine_io.cloudstack.domain: |
24 | 24 | path: "{{ cs_resource_prefix }}_domain/" |
25 | 25 | register: dom |
26 | 26 | ignore_errors: true |
27 | 27 | - name: verify results of fail if ends with / |
28 | 28 | assert: |
29 | 29 | that: |
30 | | - - dom is failed |
31 | | - - dom.msg == "Path '{{ cs_resource_prefix }}_domain/' must not end with /" |
| 30 | + - dom is failed |
| 31 | + - dom.msg == "Path '" + cs_resource_prefix + "_domain/' must not end with /" |
32 | 32 |
|
33 | 33 | - name: test create a domain in check mode |
34 | | - cs_domain: |
| 34 | + ngine_io.cloudstack.domain: |
35 | 35 | path: "{{ cs_resource_prefix }}_domain" |
36 | 36 | register: dom |
37 | 37 | check_mode: true |
38 | 38 | - name: verify results of test create a domain in check mode |
39 | 39 | assert: |
40 | 40 | that: |
41 | | - - dom is changed |
| 41 | + - dom is changed |
42 | 42 |
|
43 | 43 | - name: test create a domain |
44 | | - cs_domain: |
| 44 | + ngine_io.cloudstack.domain: |
45 | 45 | path: "{{ cs_resource_prefix }}_domain" |
46 | 46 | register: dom |
47 | 47 | - name: verify results of test create a domain |
48 | 48 | assert: |
49 | 49 | that: |
50 | | - - dom is changed |
51 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" |
52 | | - - dom.name == "{{ cs_resource_prefix }}_domain" |
| 50 | + - dom is changed |
| 51 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain" |
| 52 | + - dom.name == cs_resource_prefix + "_domain" |
53 | 53 |
|
54 | 54 | - name: test create a domain idempotence |
55 | | - cs_domain: |
| 55 | + ngine_io.cloudstack.domain: |
56 | 56 | path: "{{ cs_resource_prefix }}_domain" |
57 | 57 | register: dom |
58 | 58 | - name: verify results of test create a domain idempotence |
59 | 59 | assert: |
60 | 60 | that: |
61 | | - - dom is not changed |
62 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" |
63 | | - - dom.name == "{{ cs_resource_prefix }}_domain" |
| 61 | + - dom is not changed |
| 62 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain" |
| 63 | + - dom.name == cs_resource_prefix + "_domain" |
64 | 64 |
|
65 | 65 | - name: test create a domain idempotence2 |
66 | | - cs_domain: |
| 66 | + ngine_io.cloudstack.domain: |
67 | 67 | path: "/{{ cs_resource_prefix }}_domain" |
68 | 68 | register: dom |
69 | 69 | - name: verify results of test create a domain idempotence2 |
70 | 70 | assert: |
71 | 71 | that: |
72 | | - - dom is not changed |
73 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" |
74 | | - - dom.name == "{{ cs_resource_prefix }}_domain" |
| 72 | + - dom is not changed |
| 73 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain" |
| 74 | + - dom.name == cs_resource_prefix + "_domain" |
75 | 75 |
|
76 | 76 | - name: test fail to create a subdomain for inexistent domain |
77 | | - cs_domain: |
| 77 | + ngine_io.cloudstack.domain: |
78 | 78 | path: ROOT/inexistent/{{ cs_resource_prefix }}_subdomain |
79 | 79 | register: dom |
80 | 80 | ignore_errors: true |
81 | 81 | - name: test fail to create a subdomain for inexistent domain |
82 | 82 | assert: |
83 | 83 | that: |
84 | | - - dom is failed |
85 | | - - dom.msg == "Parent domain path ROOT/inexistent does not exist" |
| 84 | + - dom is failed |
| 85 | + - dom.msg == "Parent domain path ROOT/inexistent does not exist" |
86 | 86 |
|
87 | 87 | - name: test create a subdomain in check mode |
88 | | - cs_domain: |
| 88 | + ngine_io.cloudstack.domain: |
89 | 89 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
90 | 90 | register: dom |
91 | 91 | check_mode: true |
92 | 92 | - name: verify results of test create a domain in check mode |
93 | 93 | assert: |
94 | 94 | that: |
95 | | - - dom is changed |
| 95 | + - dom is changed |
96 | 96 |
|
97 | 97 | - name: test create a subdomain |
98 | | - cs_domain: |
| 98 | + ngine_io.cloudstack.domain: |
99 | 99 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
100 | 100 | register: dom |
101 | 101 | - name: verify results of test create a domain |
102 | 102 | assert: |
103 | 103 | that: |
104 | | - - dom is changed |
105 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
106 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 104 | + - dom is changed |
| 105 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 106 | + - dom.name == cs_resource_prefix + "_subdomain" |
107 | 107 |
|
108 | 108 | - name: test create a subdomain idempotence |
109 | | - cs_domain: |
| 109 | + ngine_io.cloudstack.domain: |
110 | 110 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
111 | 111 | register: dom |
112 | 112 | - name: verify results of test create a subdomain idempotence |
113 | 113 | assert: |
114 | 114 | that: |
115 | | - - dom is not changed |
116 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
117 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 115 | + - dom is not changed |
| 116 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 117 | + - dom.name == cs_resource_prefix + "_subdomain" |
118 | 118 |
|
119 | 119 | - name: test update a subdomain in check mode |
120 | | - cs_domain: |
| 120 | + ngine_io.cloudstack.domain: |
121 | 121 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
122 | 122 | network_domain: domain.example.com |
123 | 123 | register: dom |
124 | 124 | check_mode: true |
125 | 125 | - name: verify results of test update a subdomain in check mode |
126 | 126 | assert: |
127 | 127 | that: |
128 | | - - dom is changed |
129 | | - - dom.network_domain is undefined |
130 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
131 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 128 | + - dom is changed |
| 129 | + - dom.network_domain is undefined |
| 130 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 131 | + - dom.name == cs_resource_prefix + "_subdomain" |
132 | 132 |
|
133 | 133 | - name: test update a subdomain |
134 | | - cs_domain: |
| 134 | + ngine_io.cloudstack.domain: |
135 | 135 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
136 | 136 | network_domain: domain.example.com |
137 | 137 | register: dom |
138 | 138 | - name: verify results of test update a subdomain |
139 | 139 | assert: |
140 | 140 | that: |
141 | | - - dom is changed |
142 | | - - dom.network_domain == "domain.example.com" |
143 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
144 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 141 | + - dom is changed |
| 142 | + - dom.network_domain == "domain.example.com" |
| 143 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 144 | + - dom.name == cs_resource_prefix + "_subdomain" |
145 | 145 |
|
146 | 146 | - name: test update a subdomain idempotence |
147 | | - cs_domain: |
| 147 | + ngine_io.cloudstack.domain: |
148 | 148 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
149 | 149 | network_domain: domain.example.com |
150 | 150 | register: dom |
151 | 151 | - name: verify results of test update a subdomain idempotence |
152 | 152 | assert: |
153 | 153 | that: |
154 | | - - dom is not changed |
155 | | - - dom.network_domain == "domain.example.com" |
156 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
157 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 154 | + - dom is not changed |
| 155 | + - dom.network_domain == "domain.example.com" |
| 156 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 157 | + - dom.name == cs_resource_prefix + "_subdomain" |
158 | 158 |
|
159 | 159 | - name: test delete a subdomain in check mode |
160 | | - cs_domain: |
| 160 | + ngine_io.cloudstack.domain: |
161 | 161 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
162 | 162 | state: absent |
163 | 163 | register: dom |
164 | 164 | check_mode: true |
165 | 165 | - name: verify results of test delete a subdomain in check mode |
166 | 166 | assert: |
167 | 167 | that: |
168 | | - - dom is changed |
169 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
170 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 168 | + - dom is changed |
| 169 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 170 | + - dom.name == cs_resource_prefix + "_subdomain" |
171 | 171 |
|
172 | 172 | - name: test delete a subdomain |
173 | | - cs_domain: |
| 173 | + ngine_io.cloudstack.domain: |
174 | 174 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
175 | 175 | state: absent |
176 | 176 | register: dom |
177 | 177 | - name: verify results of test delete a subdomain |
178 | 178 | assert: |
179 | 179 | that: |
180 | | - - dom is changed |
181 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
182 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 180 | + - dom is changed |
| 181 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 182 | + - dom.name == cs_resource_prefix + "_subdomain" |
183 | 183 |
|
184 | 184 | - name: test delete a subdomain idempotence |
185 | | - cs_domain: |
| 185 | + ngine_io.cloudstack.domain: |
186 | 186 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
187 | 187 | state: absent |
188 | 188 | register: dom |
189 | 189 | - name: verify results of test delete a subdomain idempotence |
190 | 190 | assert: |
191 | 191 | that: |
192 | | - - dom is not changed |
| 192 | + - dom is not changed |
193 | 193 |
|
194 | 194 | - name: test create a subdomain 2 |
195 | | - cs_domain: |
| 195 | + ngine_io.cloudstack.domain: |
196 | 196 | path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain |
197 | 197 | register: dom |
198 | 198 | - name: verify results of test create a subdomain 2 |
199 | 199 | assert: |
200 | 200 | that: |
201 | | - - dom is changed |
202 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" |
203 | | - - dom.name == "{{ cs_resource_prefix }}_subdomain" |
| 201 | + - dom is changed |
| 202 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain/" + cs_resource_prefix + "_subdomain" |
| 203 | + - dom.name == cs_resource_prefix + "_subdomain" |
204 | 204 |
|
205 | 205 | - name: test delete a domain with clean up in check mode |
206 | | - cs_domain: |
| 206 | + ngine_io.cloudstack.domain: |
207 | 207 | path: ROOT/{{ cs_resource_prefix }}_domain |
208 | 208 | state: absent |
209 | 209 | clean_up: true |
|
212 | 212 | - name: verify results of test delete a domain with clean up in check mode |
213 | 213 | assert: |
214 | 214 | that: |
215 | | - - dom is changed |
216 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" |
217 | | - - dom.name == "{{ cs_resource_prefix }}_domain" |
| 215 | + - dom is changed |
| 216 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain" |
| 217 | + - dom.name == cs_resource_prefix + "_domain" |
218 | 218 |
|
219 | 219 | - name: test delete a domain with clean up |
220 | | - cs_domain: |
| 220 | + ngine_io.cloudstack.domain: |
221 | 221 | path: ROOT/{{ cs_resource_prefix }}_domain |
222 | 222 | state: absent |
223 | 223 | clean_up: true |
224 | 224 | register: dom |
225 | 225 | - name: verify results of test delete a domain with clean up |
226 | 226 | assert: |
227 | 227 | that: |
228 | | - - dom is changed |
229 | | - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" |
230 | | - - dom.name == "{{ cs_resource_prefix }}_domain" |
| 228 | + - dom is changed |
| 229 | + - dom.path == "ROOT/" + cs_resource_prefix + "_domain" |
| 230 | + - dom.name == "{{ cs_resource_prefix }}_domain" |
231 | 231 |
|
232 | 232 | - name: test delete a domain with clean up idempotence |
233 | | - cs_domain: |
| 233 | + ngine_io.cloudstack.domain: |
234 | 234 | path: ROOT/{{ cs_resource_prefix }}_domain |
235 | 235 | state: absent |
236 | 236 | clean_up: true |
237 | 237 | register: dom |
238 | 238 | - name: verify results of test delete a domain with clean up idempotence |
239 | 239 | assert: |
240 | 240 | that: |
241 | | - - dom is not changed |
| 241 | + - dom is not changed |
0 commit comments