|
76 | 76 | cmd: goss --gossfile - validate |
77 | 77 | stdin: "{{ lookup('ansible.builtin.template', 'goss/default.yaml.j2') }}" |
78 | 78 | changed_when: false |
79 | | - |
80 | | -############# |
81 | | -# Exclusive # |
82 | | -############# |
83 | | - |
84 | | -- name: Exclusive |
85 | | - tags: [exclusive] |
86 | | - hosts: debian |
87 | | - vars: |
88 | | - manala_php_version: 8.4 |
89 | | - tasks: |
90 | | - - name: Packages |
91 | | - ansible.builtin.apt: |
92 | | - name: |
93 | | - - php8.4-cgi # Sapi |
94 | | - - php8.4-tidy # Native extension |
95 | | - - php8.4-apcu # Pecl extension |
96 | | - install_recommends: false |
97 | | - update_cache: true |
98 | | - cache_valid_time: 3600 |
99 | | - - block: # noqa: name[missing] |
100 | | - - name: Role |
101 | | - ansible.builtin.import_role: |
102 | | - name: manala.roles.php |
103 | | - tasks_from: install |
104 | | - vars: |
105 | | - manala_php_sapis_exclusive: true |
106 | | - manala_php_sapis: |
107 | | - - cli |
108 | | - - fpm |
109 | | - manala_php_extensions_exclusive: true |
110 | | - manala_php_extensions: |
111 | | - - date # Embedded extension |
112 | | - - calendar # Common extension |
113 | | - - xml # Native extension |
114 | | - - memcached # Pecl extension |
115 | | - always: |
116 | | - - name: Goss |
117 | | - ansible.builtin.command: |
118 | | - cmd: goss --gossfile - validate |
119 | | - stdin: "{{ lookup('ansible.builtin.template', 'goss/exclusive.yaml.j2') }}" |
120 | | - changed_when: false |
121 | | - |
122 | | -########### |
123 | | -# Configs # |
124 | | -########### |
125 | | - |
126 | | -- name: Configs |
127 | | - tags: [configs] |
128 | | - hosts: debian |
129 | | - vars: |
130 | | - manala_php_version: 8.4 |
131 | | - tests_dir: /molecule/php/configs |
132 | | - tasks: |
133 | | - - name: Clean tests dir |
134 | | - ansible.builtin.file: # noqa: risky-file-permissions |
135 | | - path: "{{ tests_dir }}/{{ item.0 }}" |
136 | | - state: "{{ item.1 }}" |
137 | | - loop: | |
138 | | - {{ [ |
139 | | - 'default/cli/conf.d', 'defaults/cli/conf.d', 'exclusive/cli/conf.d', |
140 | | - 'default/fpm/conf.d', 'defaults/fpm/conf.d', 'exclusive/fpm/conf.d' |
141 | | - ] | product(['absent', 'directory']) }} |
142 | | - - name: Touch existing files |
143 | | - ansible.builtin.file: # noqa: risky-file-permissions |
144 | | - path: "{{ tests_dir }}/{{ item }}" |
145 | | - state: touch |
146 | | - loop: [ |
147 | | - default/cli/conf.d/state_absent_existing, default/cli/conf.d/state_ignore_existing, |
148 | | - default/fpm/conf.d/state_absent_existing, default/fpm/conf.d/state_ignore_existing, |
149 | | - exclusive/cli/conf.d/existing, exclusive/cli/conf.d/existing_present, exclusive/cli/conf.d/existing_ignore, |
150 | | - exclusive/cli/conf.d/existing_cli, exclusive/cli/conf.d/existing_present_cli, exclusive/cli/conf.d/existing_ignore_cli, |
151 | | - exclusive/fpm/conf.d/existing, exclusive/fpm/conf.d/existing_present, exclusive/fpm/conf.d/existing_ignore, |
152 | | - exclusive/fpm/conf.d/existing_fpm, exclusive/fpm/conf.d/existing_present_fpm, exclusive/fpm/conf.d/existing_ignore_fpm, |
153 | | - ] |
154 | | - - block: # noqa: name[missing] |
155 | | - - name: Role - Default |
156 | | - ansible.builtin.import_role: |
157 | | - name: manala.roles.php |
158 | | - tasks_from: configs |
159 | | - vars: |
160 | | - manala_php_configs_exclusive: false |
161 | | - manala_php_configs_dir: "{{ tests_dir }}/default" |
162 | | - manala_php_configs_defaults: {} |
163 | | - manala_php_configs: |
164 | | - # Dict |
165 | | - - file: dict |
166 | | - config: |
167 | | - memory_limit: 123M |
168 | | - # Content |
169 | | - - file: content |
170 | | - config: | |
171 | | - Content |
172 | | - # Template |
173 | | - - file: template |
174 | | - template: fixtures/template.j2 |
175 | | - - template: fixtures/template_file.j2 |
176 | | - # Flatten |
177 | | - - |
178 | | - - file: flatten |
179 | | - # State |
180 | | - - file: state_present_implicit |
181 | | - - file: state_present |
182 | | - state: present |
183 | | - - file: state_absent |
184 | | - state: absent |
185 | | - - file: state_absent_existing |
186 | | - state: absent |
187 | | - - file: state_ignore |
188 | | - state: ignore |
189 | | - - file: state_ignore_existing |
190 | | - state: ignore |
191 | | - manala_php_cli_configs: |
192 | | - # Dict |
193 | | - - file: dict_cli |
194 | | - config: |
195 | | - memory_limit: 255M |
196 | | - manala_php_fpm_configs: |
197 | | - # Dict |
198 | | - - file: dict_fpm |
199 | | - config: |
200 | | - memory_limit: 257M |
201 | | - - name: Role - Defaults |
202 | | - ansible.builtin.import_role: |
203 | | - name: manala.roles.php |
204 | | - tasks_from: configs |
205 | | - vars: |
206 | | - manala_php_configs_exclusive: false |
207 | | - manala_php_configs_dir: "{{ tests_dir }}/defaults" |
208 | | - manala_php_configs_defaults: |
209 | | - template: fixtures/template.j2 |
210 | | - manala_php_configs: |
211 | | - - file: template |
212 | | - - template: fixtures/template_file.j2 |
213 | | - - file: template_overwrite |
214 | | - template: fixtures/template_file.j2 |
215 | | - manala_php_cli_configs: |
216 | | - - file: template_cli |
217 | | - manala_php_fpm_configs: |
218 | | - - file: template_fpm |
219 | | - - name: Role - Exclusive |
220 | | - ansible.builtin.import_role: |
221 | | - name: manala.roles.php |
222 | | - tasks_from: configs |
223 | | - vars: |
224 | | - manala_php_configs_exclusive: true |
225 | | - manala_php_configs_dir: "{{ tests_dir }}/exclusive" |
226 | | - manala_php_configs_defaults: {} |
227 | | - manala_php_configs: |
228 | | - - file: existing_present |
229 | | - - file: existing_ignore |
230 | | - state: ignore |
231 | | - - file: ignore |
232 | | - state: ignore |
233 | | - manala_php_cli_configs: |
234 | | - - file: existing_present_cli |
235 | | - - file: existing_ignore_cli |
236 | | - state: ignore |
237 | | - - file: ignore_cli |
238 | | - state: ignore |
239 | | - manala_php_fpm_configs: |
240 | | - - file: existing_present_fpm |
241 | | - - file: existing_ignore_fpm |
242 | | - state: ignore |
243 | | - - file: ignore_fpm |
244 | | - state: ignore |
245 | | - always: |
246 | | - - name: Goss |
247 | | - ansible.builtin.command: |
248 | | - cmd: goss --gossfile - validate |
249 | | - stdin: "{{ lookup('ansible.builtin.template', 'goss/configs.yaml.j2') }}" |
250 | | - changed_when: false |
251 | | - |
252 | | -############# |
253 | | -# Fpm Pools # |
254 | | -############# |
255 | | - |
256 | | -- name: Fpm Pools |
257 | | - tags: [fpm_pools] |
258 | | - hosts: debian |
259 | | - vars: |
260 | | - manala_php_version: 8.4 |
261 | | - tests_dir: /molecule/php/fpm_pools |
262 | | - tasks: |
263 | | - - name: Clean tests dir |
264 | | - ansible.builtin.file: # noqa: risky-file-permissions |
265 | | - path: "{{ tests_dir }}/{{ item.0 }}" |
266 | | - state: "{{ item.1 }}" |
267 | | - loop: "{{ ['default', 'defaults', 'exclusive'] | product(['absent', 'directory']) }}" |
268 | | - - name: Touch existing files |
269 | | - ansible.builtin.file: # noqa: risky-file-permissions |
270 | | - path: "{{ tests_dir }}/{{ item }}" |
271 | | - state: touch |
272 | | - loop: [ |
273 | | - default/state_absent_existing, default/state_ignore_existing, |
274 | | - exclusive/existing, exclusive/existing_present, exclusive/existing_ignore, |
275 | | - ] |
276 | | - - block: # noqa: name[missing] |
277 | | - - name: Role - Default |
278 | | - ansible.builtin.import_role: |
279 | | - name: manala.roles.php |
280 | | - tasks_from: fpm_pools |
281 | | - vars: |
282 | | - manala_php_sapis: |
283 | | - - fpm |
284 | | - manala_php_fpm_pools_exclusive: false |
285 | | - manala_php_fpm_pools_dir: "{{ tests_dir }}/default" |
286 | | - manala_php_fpm_pools_defaults: {} |
287 | | - manala_php_fpm_pools: |
288 | | - # Dict |
289 | | - - file: dict |
290 | | - config: |
291 | | - www: |
292 | | - user: foo |
293 | | - group: foo |
294 | | - env: |
295 | | - FOO: bar |
296 | | - BAR: 123 |
297 | | - BAZ: 1.2 |
298 | | - QUX: foo=bar |
299 | | - php_admin_value: |
300 | | - memory_limit: 123M |
301 | | - php_value: |
302 | | - display_errors: false |
303 | | - include: |
304 | | - - /include-1 |
305 | | - - /include-2 |
306 | | - access.suppress_path: |
307 | | - - /access.suppress_path-1 |
308 | | - - /access.suppress_path-2 |
309 | | - bar: |
310 | | - user: bar |
311 | | - group: bar |
312 | | - # Content |
313 | | - - file: content |
314 | | - config: | |
315 | | - Content |
316 | | - # Template |
317 | | - - file: template |
318 | | - template: fixtures/template.j2 |
319 | | - - template: fixtures/template_file.j2 |
320 | | - # Flatten |
321 | | - - |
322 | | - - file: flatten |
323 | | - # State |
324 | | - - file: state_present_implicit |
325 | | - - file: state_present |
326 | | - state: present |
327 | | - - file: state_absent |
328 | | - state: absent |
329 | | - - file: state_absent_existing |
330 | | - state: absent |
331 | | - - file: state_ignore |
332 | | - state: ignore |
333 | | - - file: state_ignore_existing |
334 | | - state: ignore |
335 | | - - name: Role - Defaults |
336 | | - ansible.builtin.import_role: |
337 | | - name: manala.roles.php |
338 | | - tasks_from: fpm_pools |
339 | | - vars: |
340 | | - manala_php_sapis: |
341 | | - - fpm |
342 | | - manala_php_fpm_pools_exclusive: false |
343 | | - manala_php_fpm_pools_dir: "{{ tests_dir }}/defaults" |
344 | | - manala_php_fpm_pools_defaults: |
345 | | - template: fixtures/template.j2 |
346 | | - manala_php_fpm_pools: |
347 | | - - file: template |
348 | | - - template: fixtures/template_file.j2 |
349 | | - - file: template_overwrite |
350 | | - template: fixtures/template_file.j2 |
351 | | - - name: Role - Exclusive |
352 | | - ansible.builtin.import_role: |
353 | | - name: manala.roles.php |
354 | | - tasks_from: fpm_pools |
355 | | - vars: |
356 | | - manala_php_sapis: |
357 | | - - fpm |
358 | | - manala_php_fpm_pools_exclusive: true |
359 | | - manala_php_fpm_pools_dir: "{{ tests_dir }}/exclusive" |
360 | | - manala_php_fpm_pools_defaults: {} |
361 | | - manala_php_fpm_pools: |
362 | | - - file: existing_present |
363 | | - - file: existing_ignore |
364 | | - state: ignore |
365 | | - - file: ignore |
366 | | - state: ignore |
367 | | - always: |
368 | | - - name: Goss |
369 | | - ansible.builtin.command: |
370 | | - cmd: goss --gossfile - validate |
371 | | - stdin: "{{ lookup('ansible.builtin.template', 'goss/fpm_pools.yaml.j2') }}" |
372 | | - changed_when: false |
0 commit comments