|
1 | 1 | --- |
2 | 2 | - name: Include lvm role to create VG |
3 | | - include_role: |
| 3 | + ansible.builtin.include_role: |
4 | 4 | name: mrlesmithjr.manage-lvm |
5 | 5 | when: |
6 | 6 | - manage_lvm is defined |
7 | 7 | - manage_lvm |
8 | 8 | - libvirt_host_pools | map(attribute='type') | select('match', '^lvm2$') | join(',') | length > 0 |
9 | 9 |
|
10 | 10 | - name: Ensure libvirt dir storage pool directories exist |
11 | | - file: |
| 11 | + ansible.builtin.file: |
12 | 12 | path: "{{ item.path }}" |
13 | 13 | owner: "{{ item.owner }}" |
14 | 14 | group: "{{ item.group }}" |
|
18 | 18 | loop: "{{ libvirt_host_pools | flatten(levels=1) }}" |
19 | 19 | become: True |
20 | 20 |
|
21 | | -- include_tasks: |
| 21 | +- ansible.builtin.include_tasks: |
22 | 22 | file: rbd.yml |
23 | 23 | apply: |
24 | 24 | become: True |
25 | 25 | when: item.type == "rbd" |
26 | 26 | loop: "{{ libvirt_host_pools | flatten(levels=1) }}" |
27 | 27 |
|
28 | 28 | - name: Ensure libvirt storage pools are defined |
29 | | - virt_pool: |
| 29 | + community.libvirt.virt_pool: |
30 | 30 | name: "{{ item.name }}" |
31 | 31 | command: define |
32 | 32 | xml: "{{ item.xml | default(lookup('template', 'pool.xml.j2')) }}" |
|
35 | 35 | become: True |
36 | 36 |
|
37 | 37 | - name: Check libvirt directory storage pool status |
38 | | - virt_pool: |
| 38 | + community.libvirt.virt_pool: |
39 | 39 | name: "{{ item.name }}" |
40 | 40 | command: status |
41 | 41 | uri: "{{ libvirt_host_uri | default(omit, true) }}" |
|
45 | 45 | register: pool_status |
46 | 46 |
|
47 | 47 | - name: Ensure libvirt directory storage pools are built |
48 | | - virt_pool: |
| 48 | + community.libvirt.virt_pool: |
49 | 49 | name: "{{ item.item.name }}" |
50 | 50 | command: build |
51 | 51 | uri: "{{ libvirt_host_uri | default(omit, true) }}" |
|
56 | 56 | become: True |
57 | 57 |
|
58 | 58 | - name: Ensure libvirt storage pools are active |
59 | | - virt_pool: |
| 59 | + community.libvirt.virt_pool: |
60 | 60 | name: "{{ item.name }}" |
61 | 61 | state: active |
62 | 62 | uri: "{{ libvirt_host_uri | default(omit, true) }}" |
63 | 63 | loop: "{{ libvirt_host_pools | flatten(levels=1) }}" |
64 | 64 | become: True |
65 | 65 |
|
66 | 66 | - name: Ensure libvirt storage pools are started on boot |
67 | | - virt_pool: |
| 67 | + community.libvirt.virt_pool: |
68 | 68 | name: "{{ item.name }}" |
69 | 69 | autostart: yes |
70 | 70 | uri: "{{ libvirt_host_uri | default(omit, true) }}" |
|
0 commit comments