diff options
author | Matthew Fennell <matthew@fennell.dev> | 2024-01-07 13:41:50 +0000 |
---|---|---|
committer | Matthew Fennell <matthew@fennell.dev> | 2024-01-07 13:41:50 +0000 |
commit | 664d581eb277c4be8d257906b6455bcba7860093 (patch) | |
tree | 80d373c04e6bc4a5dcf49978eab841aa3fbdfecf /playbook.yaml | |
parent | ac51259e87c4777514c03d115242c083b881904f (diff) |
Only reload prosody if its configuration changes
There is no sense reloading prosody if none of its configuration files have
changed. Therefore, this commit moves the reload to a handler that only gets
triggered in this situation.
Diffstat (limited to 'playbook.yaml')
-rw-r--r-- | playbook.yaml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/playbook.yaml b/playbook.yaml index 3da1246..da17227 100644 --- a/playbook.yaml +++ b/playbook.yaml @@ -34,6 +34,7 @@ group: root mode: "0640" become: true + notify: Reload prosody - name: Ensure host-specific prosody configuration is available ansible.builtin.template: src: "{{ playbook_dir }}/files/virtual_host.cfg.lua.j2" @@ -42,6 +43,7 @@ group: root mode: "0644" become: true + notify: Reload prosody - name: Ensure host-specific prosody configuration is set ansible.builtin.file: src: "/etc/prosody/conf.avail/{{ virtual_host }}.cfg.lua" @@ -50,9 +52,16 @@ group: root state: link become: true - - name: Ensure prosody config is reloaded + notify: Reload prosody + - name: Ensure prosody is enabled ansible.builtin.service: name: prosody enabled: true + become: true + + handlers: + - name: Reload prosody + ansible.builtin.service: + name: prosody state: reloaded become: true |