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