From 5c5813f88f651ee64e507458f39cb67ecaf640cc Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Mon, 23 Jan 2023 16:29:46 +0100 Subject: [PATCH] Ensure daemon is reloaded on socket change At the moment our verification if socket has been changed is not valid, since we're checking if string 'true' is presnet in the list, while list consist of only boolean variables. So we replace map filter with selectattr as it can apply truthy test to the elements while selecting them and checking list length. Change-Id: Ib456b4dc2d631bf81633035820444f13ec0f06cb Related-Bug: #2003631 (cherry picked from commit 6a40ec0b85b96e529eb0e3e1e1a1f62cf34d80d2) --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 21a6a99..fc5c51b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -140,7 +140,7 @@ systemd: daemon_reload: yes when: - - (systemd_services_result is changed) or (systemd_timer_result is changed) or (systemd_override_result is changed ) or ('true' in systemd_socket.results | map(attribute='changed') | list ) + - (systemd_services_result is changed) or (systemd_timer_result is changed) or (systemd_override_result is changed ) or (systemd_socket.results | selectattr('changed', 'true') | length > 0) - include_tasks: systemd_load.yml loop: "{{ systemd_services }}"