author | Luke Hoersten <luke@hoersten.org> |
Sat, 22 Jul 2023 15:50:07 -0500 | |
changeset 216 | 6c85835d4621 |
parent 215 | dd52907adff9 |
child 227 | 2e0366f2dcbe |
permissions | -rw-r--r-- |
1
fd351734f007
Prometheus and WriteFreely roles are work in progress.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
1 |
--- |
fd351734f007
Prometheus and WriteFreely roles are work in progress.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
2 |
|
163 | 3 |
- name: add dendrite user |
17 | 4 |
become: yes |
174 | 5 |
user: name="{{dendrite_user}}" shell="/bin/false" system="yes" |
17 | 6 |
|
216
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
7 |
- name: create unzip dir |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
8 |
become: yes |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
9 |
file: |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
10 |
path: "/tmp/dendrite/" |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
11 |
state: "directory" |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
12 |
mode: "0755" |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
13 |
|
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
14 |
- name: unarchive dendrite bins |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
15 |
become: yes |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
16 |
unarchive: |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
17 |
remote_src: yes |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
18 |
src: "{{dendrite_tar}}" |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
19 |
dest: "/tmp/dendrite/" |
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
20 |
|
163 | 21 |
- name: install dendrite binary |
22 |
become: yes |
|
23 |
copy: |
|
216
6c85835d4621
Finished up dendrite build server role.
Luke Hoersten <luke@hoersten.org>
parents:
215
diff
changeset
|
24 |
src: "/tmp/dendrite/{{item.src}}" |
180 | 25 |
dest: "/usr/local/bin/{{item.dest}}" |
163 | 26 |
remote_src: yes |
17 | 27 |
owner: "root" |
28 |
group: "root" |
|
18
ea20908c3904
Removed use of install command.
Luke Hoersten <luke@hoersten.org>
parents:
17
diff
changeset
|
29 |
mode: "0755" |
180 | 30 |
loop: |
211 | 31 |
- {"src": "dendrite" , "dest": "dendrite"} |
32 |
- {"src": "create-account" , "dest": "dendrite-create-account"} |
|
33 |
- {"src": "dendrite-upgrade-tests" , "dest": "dendrite-upgrade-tests"} |
|
34 |
- {"src": "generate-config" , "dest": "dendrite-generate-config"} |
|
35 |
- {"src": "generate-keys" , "dest": "dendrite-generate-keys"} |
|
36 |
- {"src": "resolve-state" , "dest": "dendrite-resolve-state"} |
|
17 | 37 |
|
51 | 38 |
- name: create instance dir |
17 | 39 |
become: yes |
40 |
file: |
|
51 | 41 |
path: "{{item}}" |
17 | 42 |
state: "directory" |
163 | 43 |
owner: "{{dendrite_user}}" |
44 |
group: "{{dendrite_user}}" |
|
17 | 45 |
mode: "0755" |
169
f4f9b52ede46
Fixed dendrite restart handler bug.
Luke Hoersten <luke@hoersten.org>
parents:
168
diff
changeset
|
46 |
notify: restart service |
51 | 47 |
loop: |
163 | 48 |
- "{{dendrite_dir}}" |
49 |
- "{{dendrite_dir}}/{{dendrite_instance}}" |
|
17 | 50 |
|
183
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
51 |
- name: create instance port symlink |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
52 |
become: yes |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
53 |
file: |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
54 |
src: "{{dendrite_dir}}/{{dendrite_instance}}" |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
55 |
dest: "{{dendrite_dir}}/{{dendrite_port}}" |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
56 |
state: "link" |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
57 |
owner: "{{dendrite_user}}" |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
58 |
group: "{{dendrite_user}}" |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
59 |
mode: "0755" |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
60 |
notify: restart service |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
61 |
|
163 | 62 |
- name: install keys |
17 | 63 |
become: yes |
64 |
copy: |
|
163 | 65 |
src: "{{item}}" |
66 |
dest: "{{dendrite_dir}}/{{dendrite_instance}}/" |
|
67 |
owner: "{{dendrite_user}}" |
|
68 |
group: "{{dendrite_user}}" |
|
69 |
mode: "0600" |
|
70 |
loop: "{{dendrite_keys}}" |
|
1
fd351734f007
Prometheus and WriteFreely roles are work in progress.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
71 |
|
163 | 72 |
- name: copy db schema file |
17 | 73 |
become: yes |
74 |
template: |
|
163 | 75 |
src: "setup_db.psql.j2" |
76 |
dest: "/tmp/setup_db_dendrite_{{dendrite_instance}}.psql" |
|
77 |
owner: "postgres" |
|
78 |
group: "postgres" |
|
79 |
mode: "0600" |
|
17 | 80 |
|
163 | 81 |
- name: install db schema psql |
82 |
become: yes |
|
83 |
become_user: "postgres" |
|
84 |
command: "psql -f /tmp/setup_db_dendrite_{{dendrite_instance}}.psql" |
|
85 |
changed_when: false |
|
17 | 86 |
|
163 | 87 |
- name: configure dendrite |
17 | 88 |
become: yes |
163 | 89 |
template: |
90 |
src: "dendrite.yaml.j2" |
|
91 |
dest: "{{dendrite_dir}}/{{dendrite_instance}}/dendrite.yaml" |
|
168 | 92 |
mode: "0600" |
163 | 93 |
owner: "{{dendrite_user}}" |
94 |
group: "{{dendrite_user}}" |
|
169
f4f9b52ede46
Fixed dendrite restart handler bug.
Luke Hoersten <luke@hoersten.org>
parents:
168
diff
changeset
|
95 |
notify: restart service |
17 | 96 |
|
97 |
- name: install systemd service |
|
98 |
become: yes |
|
99 |
template: |
|
163 | 100 |
src: "[email protected]" |
101 |
dest: "/lib/systemd/system/[email protected]" |
|
186
c48761176ede
Minor version updates and bug fixes.
Luke Hoersten <luke@hoersten.org>
parents:
183
diff
changeset
|
102 |
notify: restart service |
17 | 103 |
|
183
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
104 |
- name: ensure instance service is stopped |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
105 |
become: yes |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
106 |
systemd: name="dendrite@{{dendrite_instance}}.service" enabled="no" state="stopped" daemon_reload="yes" |
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
107 |
|
17 | 108 |
- name: ensure service is started |
109 |
become: yes |
|
183
b31ef0e10cad
Added Dendrite symlink to port workaround.
Luke Hoersten <luke@hoersten.org>
parents:
180
diff
changeset
|
110 |
systemd: name="dendrite@{{dendrite_port}}.service" enabled="yes" state="started" |