Fix race condition when configuring the qemu save directory
The /var/lib/libvirt/qemu/save directory is not actually created by the installation of libvirt-bin, it is created by libvirt upon startup. So if libvirt is slow to initialize and this task runs before the directory is created, then the next task: "Check if the qemu save directory is empty" will fail with: stderr: ls: cannot access /var/lib/libvirt/qemu/save: No such file or directory Change-Id: I0d035fa6b4eaedebb733fef2126fe9c4f63c2917
This commit is contained in:
parent
f4798ed477
commit
2c641baaff
@ -16,6 +16,9 @@
|
|||||||
- name: Check the state of the default qemu save directory
|
- name: Check the state of the default qemu save directory
|
||||||
stat:
|
stat:
|
||||||
path: "/var/lib/libvirt/qemu/save"
|
path: "/var/lib/libvirt/qemu/save"
|
||||||
|
until: _qemu_save_dir.stat.exists | bool
|
||||||
|
retries: 5
|
||||||
|
delay: 10
|
||||||
register: _qemu_save_dir
|
register: _qemu_save_dir
|
||||||
|
|
||||||
- name: Check if the qemu save directory is empty
|
- name: Check if the qemu save directory is empty
|
||||||
|
Loading…
x
Reference in New Issue
Block a user