Debian Codegraph @

test/integration/targets/reboot/tasks/main.yml

raw
1 - name: Check split state
2 stat:
3 path: "{{ output_dir }}"
4 register: split
5 ignore_errors: yes
6
7 - name: >-
8 Memorize whether we're in a containerized environment
9 and/or a split controller mode
10 set_fact:
11 in_container_env: >-
12 {{
13 ansible_facts.virtualization_type | default('')
14 in ['docker', 'container', 'containerd']
15 }}
16 in_split_controller_mode: >-
17 {{ split is not success or not split.stat.exists }}
18
19 - name: Explain why testing against a container is not an option
20 debug:
21 msg: >-
22 This test is attempting to reboot the whole host operating system.
23 The current target is a containerized environment. Containers
24 cannot be reboot like VMs. This is why the test is being skipped.
25 when: in_container_env
26
27 - name: Explain why testing against the same host is not an option
28 debug:
29 msg: >-
30 This test is attempting to reboot the whole host operating system.
31 This means it would interrupt itself trying to reboot own
32 environment. It needs to target a separate VM or machine to be
33 able to function so it's being skipped in the current invocation.
34 when: not in_split_controller_mode
35
36 - name: Test reboot
37 when: not in_container_env and in_split_controller_mode
38 block:
39 - import_tasks: test_standard_scenarios.yml
40 - import_tasks: test_invalid_parameter.yml
41 - import_tasks: test_invalid_test_command.yml
42 - import_tasks: test_molly_guard.yml