|
1 | 1 | --- |
2 | 2 | - name: Gather os specific variables |
3 | | - include_vars: "{{ item }}" |
| 3 | + ansible.builtin.include_vars: "{{ item }}" |
4 | 4 | with_first_found: |
5 | 5 | - files: |
6 | 6 | - "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml" |
7 | 7 | - "{{ ansible_facts.distribution }}.yml" |
8 | 8 | - "{{ ansible_facts.os_family }}.yml" |
9 | 9 | tags: vars |
10 | 10 |
|
11 | | -- include_tasks: autodetect.yml |
| 11 | +- ansible.builtin.include_tasks: autodetect.yml |
12 | 12 | # We don't need to know the engine and emulator if we're not creating any new |
13 | 13 | # VMs. |
14 | 14 | when: >- |
|
17 | 17 |
|
18 | 18 | # Libvirt requires qemu-img to create qcow2 files. |
19 | 19 | - name: Ensure qemu-img is installed |
20 | | - package: |
| 20 | + ansible.builtin.package: |
21 | 21 | name: "{{ 'qemu-img' if ansible_facts.os_family == 'RedHat' else 'qemu-utils' }}" |
22 | 22 | update_cache: "{{ True if ansible_facts.pkg_mgr == 'apt' else omit }}" |
23 | 23 | become: true |
24 | 24 |
|
25 | | -- include_tasks: volumes.yml |
| 25 | +- ansible.builtin.include_tasks: volumes.yml |
26 | 26 | vars: |
27 | 27 | volumes: "{{ vm.volumes | default([], true) }}" |
28 | 28 | with_items: "{{ libvirt_vms }}" |
29 | 29 | loop_control: |
30 | 30 | loop_var: vm |
31 | 31 | when: (vm.state | default('present', true)) == 'present' |
32 | 32 |
|
33 | | -- include_tasks: vm.yml |
| 33 | +- ansible.builtin.include_tasks: vm.yml |
34 | 34 | vars: |
35 | 35 | console_log_enabled: "{{ vm.console_log_enabled | default(false) }}" |
36 | 36 | console_log_path: >- |
|
51 | 51 | loop_var: vm |
52 | 52 | when: (vm.state | default('present', true)) == 'present' |
53 | 53 |
|
54 | | -- include_tasks: destroy-vm.yml |
| 54 | +- ansible.builtin.include_tasks: destroy-vm.yml |
55 | 55 | vars: |
56 | 56 | boot_firmware: "{{ vm.boot_firmware | default('bios', true) | lower }}" |
57 | 57 | with_items: "{{ libvirt_vms }}" |
58 | 58 | loop_control: |
59 | 59 | loop_var: vm |
60 | 60 | when: (vm.state | default('present', true)) == 'absent' |
61 | 61 |
|
62 | | -- include_tasks: destroy-volumes.yml |
| 62 | +- ansible.builtin.include_tasks: destroy-volumes.yml |
63 | 63 | vars: |
64 | 64 | volumes: "{{ vm.volumes | default([], true) }}" |
65 | 65 | with_items: "{{ libvirt_vms }}" |
|
0 commit comments