aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/samba/handlers/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/samba/handlers/main.yml')
-rw-r--r--roles/samba/handlers/main.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/samba/handlers/main.yml b/roles/samba/handlers/main.yml
new file mode 100644
index 0000000..81dfe5e
--- /dev/null
+++ b/roles/samba/handlers/main.yml
@@ -0,0 +1,12 @@
+- name: Collect service facts
+ ansible.builtin.service_facts:
+ listen: samba_configured
+
+- name: Restart Samba service
+ become: true
+ when: |
+ 'smbd.service' in ansible_facts.services and ansible_facts.services['smbd.service'].state == 'running'
+ ansible.builtin.systemd_service:
+ name: smbd
+ state: restarted
+ listen: samba_configured