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 6a40ec0b85)
This commit is contained in:
Dmitriy Rabotyagov 2023-01-23 16:29:46 +01:00 committed by Dmitriy Rabotyagov
parent aa6b331296
commit 6551e127f2
1 changed files with 1 additions and 1 deletions

View File

@ -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 }}"