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