Check if /etc/libvirt/qemu/*xml exists before sync
Some checks reported errors
continuous-integration/drone/push Build was killed

This will prevent sending e-mails saying the file
does not exists.
This commit is contained in:
Alexis Ben Miloud--Josselin 2022-03-03 11:48:39 +01:00
parent 9c84e95182
commit d455de52b3

View file

@ -33,7 +33,7 @@
state: present
special_time: "hourly"
user: root
job: "rsync -a --delete /etc/libvirt/qemu/*xml {{ hostvars[kvm_pair]['lan.ip'] }}:/root/libvirt-{{ inventory_hostname }}/"
job: "if ! ls /etc/libvirt/qemu/*xml > /dev/null 2> /dev/null; then rsync -a --delete /etc/libvirt/qemu/*xml {{ hostvars[kvm_pair]['lan.ip'] }}:/root/libvirt-{{ inventory_hostname }}/; fi"
when:
- kvm_pair is defined
- kvm_pair is not none