File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- - name : Ensure libvirt dir storage pool directories exist
3
- file :
4
- path : " {{ item.path }}"
5
- owner : " {{ item.owner }}"
6
- group : " {{ item.group }}"
7
- mode : " {{ item.mode|int(base=8) }}"
8
- state : directory
9
- when : item.type == "dir"
10
- loop : " {{ libvirt_host_pools | flatten(levels=1) }}"
11
- become : True
12
-
13
2
- name : Ensure libvirt LVM storage pool directories exist
14
3
lvg :
15
4
vg : " {{ item.source }}"
34
23
loop : " {{ libvirt_host_pools | flatten(levels=1) }}"
35
24
become : True
36
25
26
+ - name : Check libvirt directory storage pool status
27
+ virt_pool :
28
+ name : " {{ item.name }}"
29
+ command : status
30
+ uri : " {{ libvirt_host_uri | default(omit, true) }}"
31
+ when : item.type == "dir"
32
+ loop : " {{ libvirt_host_pools | flatten(levels=1) }}"
33
+ become : True
34
+ register : pool_status
35
+
36
+ - name : Ensure libvirt directory storage pools are built
37
+ virt_pool :
38
+ name : " {{ item.item.name }}"
39
+ command : build
40
+ uri : " {{ libvirt_host_uri | default(omit, true) }}"
41
+ when :
42
+ - item is not skipped
43
+ - item.status != "active"
44
+ loop : " {{ pool_status.results }}"
45
+ become : True
46
+
37
47
- name : Ensure libvirt storage pools are active
38
48
virt_pool :
39
49
name : " {{ item.name }}"
You can’t perform that action at this time.
0 commit comments