|
@@ -16,6 +16,9 @@
|
16
|
16
|
tags:
|
17
|
17
|
- dependencies
|
18
|
18
|
|
|
19
|
+- name: Add prosody user to ssl-cert group
|
|
20
|
+ user: name=prosody group=ssl-cert
|
|
21
|
+
|
19
|
22
|
- name: Create Prosody data directory
|
20
|
23
|
file: state=directory path=/decrypted/prosody owner=prosody group=prosody
|
21
|
24
|
|
|
@@ -23,23 +26,6 @@
|
23
|
26
|
template: src=prosody.cfg.lua.j2 dest=/etc/prosody/prosody.cfg.lua group=root owner=root
|
24
|
27
|
notify: restart prosody
|
25
|
28
|
|
26
|
|
-- name: Copy SSL private key and cert
|
27
|
|
- shell: cp /etc/letsencrypt/live/{{ domain }}/{{ item }} /etc/prosody/certs
|
28
|
|
- with_items:
|
29
|
|
- - privkey.pem
|
30
|
|
- - cert.pem
|
31
|
|
-
|
32
|
|
-- name: Assert mode and ownership on SSL private key and cert
|
33
|
|
- file: dest=/etc/prosody/certs/{{ item }} owner=root group=prosody mode=0640
|
34
|
|
- with_items:
|
35
|
|
- - privkey.pem
|
36
|
|
- - cert.pem
|
37
|
|
-
|
38
|
|
-- name: Update certificate renewal cron job
|
39
|
|
- lineinfile: dest=/etc/cron.monthly/letsencrypt-renew state=present
|
40
|
|
- line="cp /etc/letsencrypt/live/{{ domain }}/{privkey,cert}.pem /etc/prosody/certs; chown root.prosody /etc/prosody/certs/{privkey,cert}.pem; chmod 640 /etc/prosody/certs/{privkey,cert}.pem; service prosody restart"
|
41
|
|
- insertafter="EOF"
|
42
|
|
-
|
43
|
29
|
- name: Create Prosody accounts
|
44
|
30
|
command: prosodyctl register {{ item.name }} {{ prosody_virtual_domain }} "{{ item.password }}"
|
45
|
31
|
with_items: prosody_accounts
|