aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/systemd_depend_iface/handlers/service.yml
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-23 18:35:25 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-23 18:57:52 +0200
commitaeb8685d4861c6da1f5bd444c7a1ab4ba96a2f24 (patch)
tree81ec67d9ddff134d9e11b2c669db503251816ca5 /roles/systemd_depend_iface/handlers/service.yml
parentadd role systemd_depend_iface (diff)
downloadinfra-ansible-aeb8685d4861c6da1f5bd444c7a1ab4ba96a2f24.tar.gz
infra-ansible-aeb8685d4861c6da1f5bd444c7a1ab4ba96a2f24.zip
systemd_depend_*: don't restart missing services
Diffstat (limited to '')
-rw-r--r--roles/systemd_depend_iface/handlers/service.yml6
1 files changed, 6 insertions, 0 deletions
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