podman/systemd: relax the "until" condition

On slow systems, it's possible that systemd takes more time than usual
to execute a task from Ansible (e.g. service restart); so Ansible
doesn't have yet the registered facts from systemd.

To make sure that Ansible doesn't fail with:
dict object' has no attribute 'status'

We first check if status is defined.

Change-Id: Ie73cecc115c87fe452a90892755a1df5b3d894a7
Closes-Bug: #1877449
This commit is contained in:
Emilien Macchi 2020-05-07 23:19:18 -04:00
parent 9f27089134
commit 0c0f904ef5
1 changed files with 1 additions and 1 deletions

View File

@ -60,6 +60,6 @@
loop_control: loop_control:
loop_var: container_sysd_name loop_var: container_sysd_name
register: systemd_service_enable register: systemd_service_enable
until: systemd_service_enable.status.Result == "success" until: (systemd_service_enable.status is defined) and (systemd_service_enable.status.Result == "success")
retries: 5 retries: 5
delay: 5 delay: 5