author | Luke Hoersten <luke@hoersten.org> |
Mon, 20 Jan 2020 13:18:18 -0600 | |
changeset 88 | 63efc98132f7 |
parent 86 | 3dcdaac4adbf |
permissions | -rw-r--r-- |
60 | 1 |
--- |
2 |
||
3 |
- name: add erland solutions key |
|
4 |
become: yes |
|
75
d8c87a41cc6d
Pleroma role updates. Added Postgresql role.
Luke Hoersten <luke@hoersten.org>
parents:
74
diff
changeset
|
5 |
apt_key: url="http://packages.erlang-solutions.com/debian/erlang_solutions.asc" |
60 | 6 |
|
7 |
- name: install erland solutions repo |
|
8 |
become: yes |
|
75
d8c87a41cc6d
Pleroma role updates. Added Postgresql role.
Luke Hoersten <luke@hoersten.org>
parents:
74
diff
changeset
|
9 |
apt_repository: repo="deb http://binaries.erlang-solutions.com/debian buster contrib" |
60 | 10 |
|
11 |
- name: update apt package cache |
|
12 |
become: yes |
|
13 |
apt: upgrade="dist" update_cache="yes" cache_valid_time="3600" |
|
14 |
||
73
3e6344570822
Fixed deprecated ansible syntax.
Luke Hoersten <luke@hoersten.org>
parents:
69
diff
changeset
|
15 |
- name: install pleroma apt packages |
60 | 16 |
become: yes |
73
3e6344570822
Fixed deprecated ansible syntax.
Luke Hoersten <luke@hoersten.org>
parents:
69
diff
changeset
|
17 |
apt: name="{{pleroma_apt_packages}}" |
60 | 18 |
|
19 |
- name: add users |
|
20 |
become: yes |
|
21 |
user: name="{{pleroma_user}}" shell="/bin/bash" |
|
22 |
||
23 |
- name: checkout plemora |
|
24 |
become: yes |
|
25 |
become_user: "{{pleroma_user}}" |
|
26 |
git: |
|
27 |
repo: "https://git.pleroma.social/pleroma/pleroma.git" |
|
28 |
dest: "~{{pleroma_user}}/pleroma" |
|
75
d8c87a41cc6d
Pleroma role updates. Added Postgresql role.
Luke Hoersten <luke@hoersten.org>
parents:
74
diff
changeset
|
29 |
version: "{{pleroma_version}}" |
60 | 30 |
force: yes |
31 |
||
81 | 32 |
- name: install pleroma config |
60 | 33 |
template: |
81 | 34 |
src: "prod.secret.exs.j2" |
35 |
dest: "~{{pleroma_user}}/pleroma/config/prod.secret.exs" |
|
60 | 36 |
owner: "{{pleroma_user}}" |
37 |
group: "{{pleroma_user}}" |
|
86 | 38 |
mode: "0600" |
60 | 39 |
become: yes |
62
63586cf10d46
Added more config variables to pleroma.
Luke Hoersten <luke@hoersten.org>
parents:
60
diff
changeset
|
40 |
notify: restart pleroma |
60 | 41 |
|
81 | 42 |
- name: install pleroma db schema file |
43 |
template: |
|
44 |
src: "setup_db.psql.j2" |
|
45 |
dest: "/tmp/setup_db.psql" |
|
46 |
owner: "{{pleroma_db_superuser}}" |
|
47 |
group: "{{pleroma_db_superuser}}" |
|
86 | 48 |
mode: "0600" |
81 | 49 |
become: yes |
50 |
||
60 | 51 |
- name: install pleroma psql |
52 |
become: yes |
|
66 | 53 |
become_user: "{{pleroma_db_superuser}}" |
81 | 54 |
command: "psql -f /tmp/setup_db.psql" |
62
63586cf10d46
Added more config variables to pleroma.
Luke Hoersten <luke@hoersten.org>
parents:
60
diff
changeset
|
55 |
notify: restart pleroma |
75
d8c87a41cc6d
Pleroma role updates. Added Postgresql role.
Luke Hoersten <luke@hoersten.org>
parents:
74
diff
changeset
|
56 |
|
60 | 57 |
- name: migrate db |
58 |
become: yes |
|
59 |
become_user: "{{pleroma_user}}" |
|
60 |
command: "{{item}}" |
|
61 |
args: |
|
62 |
chdir: "~{{pleroma_user}}/pleroma/" |
|
63 |
with_items: |
|
64 |
- "mix local.hex --force" |
|
65 |
- "mix local.rebar --force" |
|
66 |
- "mix deps.get" |
|
74 | 67 |
- "mix ecto.migrate" |
62
63586cf10d46
Added more config variables to pleroma.
Luke Hoersten <luke@hoersten.org>
parents:
60
diff
changeset
|
68 |
notify: restart pleroma |
65
4538ad030906
Moved mix commands to prod.
Luke Hoersten <luke@hoersten.org>
parents:
64
diff
changeset
|
69 |
environment: |
4538ad030906
Moved mix commands to prod.
Luke Hoersten <luke@hoersten.org>
parents:
64
diff
changeset
|
70 |
MIX_ENV: "prod" |
60 | 71 |
|
72 |
- name: install pleroma systemd service |
|
73 |
template: |
|
74 |
src: "pleroma.service.j2" |
|
67 | 75 |
dest: "/lib/systemd/system/{{pleroma_user}}.service" |
60 | 76 |
owner: "{{pleroma_user}}" |
77 |
group: "{{pleroma_user}}" |
|
86 | 78 |
mode: "0660" |
60 | 79 |
become: yes |
80 |
||
81 |
- name: enable pleroma systemd service |
|
67 | 82 |
systemd: name="{{pleroma_user}}" enabled="yes" state="started" |
60 | 83 |
become: yes |