From aeb8685d4861c6da1f5bd444c7a1ab4ba96a2f24 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 23 Aug 2023 18:35:25 +0200 Subject: systemd_depend_*: don't restart missing services --- roles/systemd_depend_iface/handlers/service.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 roles/systemd_depend_iface/handlers/service.yml (limited to 'roles/systemd_depend_iface/handlers/service.yml') diff --git a/roles/systemd_depend_iface/handlers/service.yml b/roles/systemd_depend_iface/handlers/service.yml new file mode 100644 index 0000000..10ead91 --- /dev/null +++ b/roles/systemd_depend_iface/handlers/service.yml @@ -0,0 +1,6 @@ +- name: 'Restart {{ service }}' + become: true + ansible.builtin.systemd_service: + name: '{{ service }}' + state: restarted + when: service in ansible_facts.services -- cgit v1.2.3