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 11---
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-
132- name : Ensure libvirt LVM storage pool directories exist
143 lvg :
154 vg : " {{ item.source }}"
3423 loop : " {{ libvirt_host_pools | flatten(levels=1) }}"
3524 become : True
3625
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+
3747- name : Ensure libvirt storage pools are active
3848 virt_pool :
3949 name : " {{ item.name }}"
You can’t perform that action at this time.
0 commit comments