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