1
0
forked from infra/ansible
infra/roles/prosody/tasks/main.yml

43 lines
1.2 KiB
YAML
Raw Normal View History

2016-02-11 16:15:38 +01:00
---
2019-09-09 19:09:44 +02:00
- name: Install prosody
apt:
name:
- prosody
- libsasl2-modules-ldap
2021-09-02 21:15:41 +02:00
- lua-cyrussasl
- sasl2-bin
2016-02-11 16:15:38 +01:00
2016-04-08 09:07:06 +02:00
- name: Ensure certificates are available
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/prosody/certs/{{ prosody_domain }}.key -out /etc/prosody/certs/{{ prosody_domain }}.crt -days 730 -subj "/CN={{ prosody_domain }}" creates=/etc/prosody/certs/{{ prosody_domain }}.crt
2016-02-11 16:15:38 +01:00
2016-04-08 09:07:06 +02:00
- name: Ensure prosody is in sasl group
user: name=prosody groups=sasl
- name: Ensure sasl configuration directory exists
file: path=/etc/sasl/ state=directory
- name: Configure sasl
copy: src={{ item }} dest=/etc/{{ item }}
with_items:
- default/saslauthd
- sasl/xmpp.conf
- name: Configure sasl
template: src=saslauthd.conf.j2 dest=/etc/saslauthd.conf
notify: Restart saslauthd
2016-02-11 16:15:38 +01:00
- name: Configure prosody
template: src=prosody.cfg.lua.j2 dest=/etc/prosody/prosody.cfg.lua
2016-02-15 19:17:28 +01:00
notify: Restart prosody
2016-04-08 09:07:06 +02:00
2016-04-08 09:28:53 +02:00
- name: Configure certificate manager
2019-05-20 19:49:08 +02:00
template: src=certs.j2 dest=/etc/acertmgr/{{ prosody_domain }}_prosody.conf
notify: Run acertmgr
2016-04-08 09:28:53 +02:00
2016-04-08 09:07:06 +02:00
- name: Start saslauthd
service: name=saslauthd state=started enabled=yes
2016-02-11 16:15:38 +01:00
- name: Start prosody
service: name=prosody state=started enabled=yes