aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/systemd_depend_mount/handlers/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/systemd_depend_mount/handlers/main.yml')
-rw-r--r--roles/systemd_depend_mount/handlers/main.yml11
1 files changed, 7 insertions, 4 deletions
diff --git a/roles/systemd_depend_mount/handlers/main.yml b/roles/systemd_depend_mount/handlers/main.yml
index 81bae32..207c203 100644
--- a/roles/systemd_depend_mount/handlers/main.yml
+++ b/roles/systemd_depend_mount/handlers/main.yml
@@ -4,10 +4,13 @@
daemon_reload: true
listen: systemd_depend_mount_restart
+- name: Collect installed services
+ ansible.builtin.service_facts:
+ listen: systemd_depend_mount_restart
+
- name: Restart systemd services
- become: true
- ansible.builtin.systemd_service:
- name: '{{ item }}'
- state: restarted
+ ansible.builtin.include_tasks: service.yml
listen: systemd_depend_mount_restart
loop: "{{ systemd_depend_mount_result.results | selectattr('changed', 'equalto', true) | map(attribute='service') | list }}"
+ loop_control:
+ loop_var: service