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:
Logan V 2016-08-11 09:14:20 -05:00 committed by Jesse Pretorius (odyssey4me)
parent f4798ed477
commit 2c641baaff

View File

@ -16,6 +16,9 @@
- name: Check the state of the default qemu save directory
stat:
path: "/var/lib/libvirt/qemu/save"
until: _qemu_save_dir.stat.exists | bool
retries: 5
delay: 10
register: _qemu_save_dir
- name: Check if the qemu save directory is empty