diff options
-rw-r--r-- | files/virtual_host.cfg.lua.j2 | 5 | ||||
-rw-r--r-- | playbook.yaml | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/files/virtual_host.cfg.lua.j2 b/files/virtual_host.cfg.lua.j2 index 4558209..fae0cfd 100644 --- a/files/virtual_host.cfg.lua.j2 +++ b/files/virtual_host.cfg.lua.j2 @@ -7,6 +7,7 @@ VirtualHost "{{ virtual_host }}" admins = { "admin@{{ virtual_host }}" }; modules_enabled = { + "groups"; "invites"; "invites_adhoc"; "invites_api"; @@ -17,6 +18,10 @@ modules_enabled = { "turn_external"; } +{%- if roster_groups is defined %} +groups_file = "/etc/prosody/groups/{{ virtual_host }}.toml" +{% endif %} + contact_info = { abuse = { "xmpp:abuse@{{ virtual_host }}" }; admin = { "xmpp:admin@{{ virtual_host }}" }; diff --git a/playbook.yaml b/playbook.yaml index 4c366f1..dd3281b 100644 --- a/playbook.yaml +++ b/playbook.yaml @@ -385,6 +385,27 @@ state: absent become: true + - name: Ensure prosody groups directory is created + ansible.builtin.file: + path: /etc/prosody/groups + state: directory + owner: root + mode: '0754' + group: prosody + become: true + when: roster_groups is defined + + - name: Ensure prosody groups are defined + ansible.builtin.copy: + content: "{{ roster_groups }}" + dest: "/etc/prosody/groups/{{ virtual_host }}.toml" + owner: root + group: prosody + mode: '0640' + become: true + notify: Restart prosody + when: roster_groups is defined + - name: Ensure prosody users are registered ansible.builtin.expect: command: "prosodyctl adduser {{ item.name }}@{{ virtual_host }}" |