From 0c0f904ef56d23535fa4137d2ae3005a87ecb614 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 7 May 2020 23:19:18 -0400 Subject: [PATCH] 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 --- .../roles/tripleo_container_manage/tasks/podman/systemd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/systemd.yml b/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/systemd.yml index 804d40079..2b597e8bd 100644 --- a/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/systemd.yml +++ b/tripleo_ansible/roles/tripleo_container_manage/tasks/podman/systemd.yml @@ -60,6 +60,6 @@ loop_control: loop_var: container_sysd_name 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 delay: 5