author | Luke Hoersten <luke@hoersten.org> |
Sat, 19 Jan 2019 13:32:43 -0600 | |
changeset 73 | 3e6344570822 |
parent 69 | be979818d483 |
child 74 | dc20ec78acdd |
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 |
||
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" |
|
29 |
force: yes |
|
30 |
||
31 |
- name: install pleroma config files |
|
32 |
template: |
|
33 |
src: "{{item}}.j2" |
|
34 |
dest: "~{{pleroma_user}}/pleroma/config/{{item}}" |
|
35 |
owner: "{{pleroma_user}}" |
|
36 |
group: "{{pleroma_user}}" |
|
37 |
mode: "0775" |
|
38 |
become: yes |
|
39 |
become_user: "{{pleroma_user}}" |
|
40 |
with_items: |
|
41 |
- "setup_db.psql" |
|
64 | 42 |
- "prod.secret.exs" |
62
63586cf10d46
Added more config variables to pleroma.
Luke Hoersten <luke@hoersten.org>
parents:
60
diff
changeset
|
43 |
notify: restart pleroma |
60 | 44 |
|
45 |
- name: install pleroma psql |
|
46 |
become: yes |
|
66 | 47 |
become_user: "{{pleroma_db_superuser}}" |
48 |
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
|
49 |
notify: restart pleroma |
66 | 50 |
environment: |
51 |
PGUSER: "{{pleroma_db_superuser}}" |
|
52 |
PGPASSWORD: "{{pleroma_db_superpass}}" |
|
60 | 53 |
|
54 |
- name: migrate db |
|
55 |
become: yes |
|
56 |
become_user: "{{pleroma_user}}" |
|
57 |
command: "{{item}}" |
|
58 |
args: |
|
59 |
chdir: "~{{pleroma_user}}/pleroma/" |
|
60 |
with_items: |
|
61 |
- "mix local.hex --force" |
|
62 |
- "mix local.rebar --force" |
|
63 |
- "mix deps.get" |
|
69 | 64 |
# - "mix ecto.migrate" |
62
63586cf10d46
Added more config variables to pleroma.
Luke Hoersten <luke@hoersten.org>
parents:
60
diff
changeset
|
65 |
notify: restart pleroma |
65
4538ad030906
Moved mix commands to prod.
Luke Hoersten <luke@hoersten.org>
parents:
64
diff
changeset
|
66 |
environment: |
4538ad030906
Moved mix commands to prod.
Luke Hoersten <luke@hoersten.org>
parents:
64
diff
changeset
|
67 |
MIX_ENV: "prod" |
60 | 68 |
|
69 |
- name: install pleroma systemd service |
|
70 |
template: |
|
71 |
src: "pleroma.service.j2" |
|
67 | 72 |
dest: "/lib/systemd/system/{{pleroma_user}}.service" |
60 | 73 |
owner: "{{pleroma_user}}" |
74 |
group: "{{pleroma_user}}" |
|
75 |
mode: "0770" |
|
76 |
become: yes |
|
77 |
||
78 |
- name: enable pleroma systemd service |
|
67 | 79 |
systemd: name="{{pleroma_user}}" enabled="yes" state="started" |
60 | 80 |
become: yes |