author | Luke Hoersten <luke@hoersten.org> |
Sun, 28 Jun 2020 15:08:36 -0500 | |
changeset 54 | 1ea4f1c7c675 |
parent 45 | 2d7ba960b157 |
child 138 | 591b6609fc64 |
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 |
||
44 | 23 |
- name: copy ssl keys |
24 |
become: yes |
|
25 |
copy: |
|
26 |
src: "{{item}}" |
|
27 |
dest: "{{prosody_ssl_dir}}/" |
|
28 |
remote_src: yes |
|
29 |
mode: "0640" |
|
30 |
owner: "root" |
|
31 |
group: "prosody" |
|
32 |
notify: restart prosody |
|
33 |
loop: |
|
34 |
- "{{prosody_ssl_privkey_src}}" |
|
35 |
- "{{prosody_ssl_cert_src}}" |
|
36 |
||
45
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
37 |
- name: install db schema file |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
38 |
become: yes |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
39 |
template: |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
40 |
src: "setup_db.psql.j2" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
41 |
dest: "/tmp/setup_db_{{prosody_db}}.psql" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
42 |
owner: "postgres" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
43 |
group: "postgres" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
44 |
mode: "0600" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
45 |
changed_when: false |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
46 |
|
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
47 |
- name: install psql |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
48 |
become: yes |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
49 |
become_user: "postgres" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
50 |
command: "psql -f /tmp/setup_db_{{prosody_db}}.psql" |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
51 |
changed_when: false |
2d7ba960b157
Added postgresql for prosody.
Luke Hoersten <luke@hoersten.org>
parents:
44
diff
changeset
|
52 |
|
23 | 53 |
- name: enable prosody site |
54 |
become: yes |
|
55 |
file: |
|
56 |
src: "/etc/prosody/conf.avail/{{prosody_vhost}}.cfg.lua" |
|
57 |
dest: "/etc/prosody/conf.d/{{prosody_vhost}}.cfg.lua" |
|
58 |
state: "link" |
|
59 |
notify: restart prosody |