diff --git a/roles/float-util-credentials/tasks/main.yml b/roles/float-util-credentials/tasks/main.yml index dcf4ce4f80ac1ae8e644df5b823ccb5e35c9364c..9d202eb9c732fe57da5ad50df61204d2161669ea 100644 --- a/roles/float-util-credentials/tasks/main.yml +++ b/roles/float-util-credentials/tasks/main.yml @@ -103,8 +103,8 @@ # This should use the systemd module but it doesn't take lists of services. - name: "Restart associated services" - shell: "systemctl restart {{ all_systemd_units.stdout_lines | intersect(services[item.0.service].systemd_services) | join(' ') }}" - when: "item.1.changed and item.0.service != 'LOCAL' and services[item.0.service].systemd_services" + shell: "systemctl try-reload-or-restart {{ all_systemd_units.stdout_lines | intersect(services[item.0.service].systemd_services) | join(' ') }}" + when: "item.1.changed and item.0.service != 'LOCAL' and (all_systemd_units.stdout_lines | intersect(services[item.0.service].systemd_services))" loop: "{{ credentials | zip(x509_sign.results) | list }}" rescue: