aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/systemd_depend_mount/handlers
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-23 17:46:28 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-23 18:03:25 +0200
commit287264d1eefb311b472a5f0431ae012cf2033a26 (patch)
treee65a79c80c6fb741ac45e359ba32e6192acaf396 /roles/systemd_depend_mount/handlers
parentdigitalocean_volume: properly prefix variables (diff)
downloadinfra-ansible-287264d1eefb311b472a5f0431ae012cf2033a26.tar.gz
infra-ansible-287264d1eefb311b472a5f0431ae012cf2033a26.zip
replace systemd_requires_mounts_for with systemd_depend_mount
It should be better and more comprehensible.
Diffstat (limited to 'roles/systemd_depend_mount/handlers')
-rw-r--r--roles/systemd_depend_mount/handlers/main.yml13
1 files changed, 13 insertions, 0 deletions
diff --git a/roles/systemd_depend_mount/handlers/main.yml b/roles/systemd_depend_mount/handlers/main.yml
new file mode 100644
index 0000000..81bae32
--- /dev/null
+++ b/roles/systemd_depend_mount/handlers/main.yml
@@ -0,0 +1,13 @@
+- name: Reload systemd daemon
+ become: true
+ ansible.builtin.systemd_service:
+ daemon_reload: true
+ listen: systemd_depend_mount_restart
+
+- name: Restart systemd services
+ become: true
+ ansible.builtin.systemd_service:
+ name: '{{ item }}'
+ state: restarted
+ listen: systemd_depend_mount_restart
+ loop: "{{ systemd_depend_mount_result.results | selectattr('changed', 'equalto', true) | map(attribute='service') | list }}"