From 3c55245c39d78dde94705f49ae1ec0d85c678190 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 19 Sep 2023 15:03:30 +0200 Subject: systemd_depend_*: don't restart services First, I don't think it's even necessary. If the service wasn't running, then we don't need to restart it. If it was running, it'll continue running fine with a new dependency; it'll be picked up on a future restart. Second, all of that doesn't even work due to (another) weird way Ansible treats handlers: https://github.com/ansible/ansible/issues/81722 --- roles/systemd_depend_mount/tasks/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'roles/systemd_depend_mount/tasks/main.yml') diff --git a/roles/systemd_depend_mount/tasks/main.yml b/roles/systemd_depend_mount/tasks/main.yml index d759b00..32b83d6 100644 --- a/roles/systemd_depend_mount/tasks/main.yml +++ b/roles/systemd_depend_mount/tasks/main.yml @@ -18,11 +18,10 @@ owner: root group: root mode: '644' - register: systemd_depend_mount_result - notify: systemd_depend_mount_restart + notify: systemd_depend_mount_reload loop: '{{ systemd_depend_mount_services }}' loop_control: loop_var: service -- name: Restart systemd services if necessary +- name: Reload systemd services if necessary ansible.builtin.meta: flush_handlers -- cgit v1.2.3