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