aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/systemd_depend_iface/handlers/main.yml
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-23 18:06:40 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-23 18:11:44 +0200
commit622921151674a71fda88b405a576847e69cd3c83 (patch)
tree403cdfc0f6350174e138750ba2706bd67f77e652 /roles/systemd_depend_iface/handlers/main.yml
parentreplace systemd_requires_mounts_for with systemd_depend_mount (diff)
downloadinfra-ansible-622921151674a71fda88b405a576847e69cd3c83.tar.gz
infra-ansible-622921151674a71fda88b405a576847e69cd3c83.zip
add role systemd_depend_iface
Diffstat (limited to '')
-rw-r--r--roles/systemd_depend_iface/handlers/main.yml13
1 files changed, 13 insertions, 0 deletions
diff --git a/roles/systemd_depend_iface/handlers/main.yml b/roles/systemd_depend_iface/handlers/main.yml
new file mode 100644
index 0000000..2782200
--- /dev/null
+++ b/roles/systemd_depend_iface/handlers/main.yml
@@ -0,0 +1,13 @@
+- name: Reload systemd daemon
+ become: true
+ ansible.builtin.systemd_service:
+ daemon_reload: true
+ listen: systemd_depend_iface_restart
+
+- name: Restart systemd services
+ become: true
+ ansible.builtin.systemd_service:
+ name: '{{ item }}'
+ state: restarted
+ listen: systemd_depend_iface_restart
+ loop: "{{ systemd_depend_iface_result.results | selectattr('changed', 'equalto', true) | map(attribute='service') | list }}"