Skip to content
Snippets Groups Projects
Commit 28ab754a authored by ale's avatar ale
Browse files

Do not run systemctl commands without arguments

And use try-reload-or-restart, to be more amenable to failures.
parent e90d126d
No related branches found
No related tags found
1 merge request!183Reduce the number of expected errors
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment