author | Luke Hoersten <luke@hoersten.org> |
Mon, 16 Nov 2020 16:43:09 -0600 | |
changeset 144 | 267d58c0e186 |
parent 138 | 591b6609fc64 |
child 237 | c6c11084c802 |
permissions | -rw-r--r-- |
23 | 1 |
--- |
2 |
||
3 |
- name: install prosody |
|
4 |
become: yes |
|
45
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
5 |
apt: name="{{item}}" |
23 | 6 |
notify: restart prosody |
45
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
7 |
loop: |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
8 |
- "prosody" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
9 |
- "lua-dbi-postgresql" |
23 | 10 |
|
11 |
- name: configure prosody |
|
12 |
become: yes |
|
13 |
template: |
|
14 |
src: "prosody.cfg.lua.j2" |
|
15 |
dest: "/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua" |
|
16 |
notify: restart prosody |
|
17 |
||
18 |
- name: install prosody site |
|
19 |
become: yes |
|
20 |
template: src="prosody.cfg.lua.j2" dest="/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua" |
|
21 |
notify: restart prosody |
|
22 |
||
138
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
23 |
- name: install letsencrypt ssl deploy hook |
44 | 24 |
become: yes |
25 |
copy: |
|
138
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
26 |
src: "prosody.sh" |
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
27 |
dest: "/etc/letsencrypt/renewal-hooks/deploy/prosody.sh" |
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
28 |
mode: "0755" |
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
29 |
|
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
30 |
- name: run letsencrypt ssl deploy hook |
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
31 |
become: yes |
591b6609fc64
Use proper ssl cert config for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
45
diff
changeset
|
32 |
command: "/etc/letsencrypt/renewal-hooks/deploy/prosody.sh" |
44 | 33 |
notify: restart prosody |
34 |
||
45
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
35 |
- name: install db schema file |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
36 |
become: yes |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
37 |
template: |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
38 |
src: "setup_db.psql.j2" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
39 |
dest: "/tmp/setup_db_{{prosody_db}}.psql" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
40 |
owner: "postgres" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
41 |
group: "postgres" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
42 |
mode: "0600" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
43 |
changed_when: false |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
44 |
|
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
45 |
- name: install psql |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
46 |
become: yes |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
47 |
become_user: "postgres" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
48 |
command: "psql -f /tmp/setup_db_{{prosody_db}}.psql" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
49 |
changed_when: false |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
50 |
|
23 | 51 |
- name: enable prosody site |
52 |
become: yes |
|
53 |
file: |
|
54 |
src: "/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua" |
|
55 |
dest: "/etc/prosody/conf.d/{{prosody_vhost}}.cfg.lua" |
|
56 |
state: "link" |
|
57 |
notify: restart prosody |