|
1 --- |
|
2 |
|
3 - name: install pleroma apt packages |
|
4 become: yes |
|
5 apt: name="{{pleroma_apt_packages}}" |
|
6 |
|
7 - name: add users |
|
8 become: yes |
|
9 user: name="pleroma" shell="/bin/false" home="/opt/pleroma" system="yes" |
|
10 |
|
11 - name: create config and data directory |
|
12 become: yes |
|
13 file: |
|
14 path: "{{item}}" |
|
15 state: "directory" |
|
16 mode: "0755" |
|
17 with_items: |
|
18 - "{{pleroma_data_dir}}" |
|
19 - "/etc/pleroma" |
|
20 |
|
21 - name: install pleroma config |
|
22 template: |
|
23 src: "config.exs.j2" |
|
24 dest: "/etc/pleroma/{{pleroma_instance}}.config.exs" |
|
25 mode: "0700" |
|
26 become: yes |
|
27 notify: "restart pleroma {{pleroma_instance}} instance" |
|
28 |
|
29 - name: create instance data directory |
|
30 become: yes |
|
31 file: |
|
32 path: "{{item}}" |
|
33 state: "directory" |
|
34 owner: "pleroma" |
|
35 group: "pleroma" |
|
36 mode: "0755" |
|
37 with_items: |
|
38 - "{{pleroma_data_dir}}/{{pleroma_instance}}" |
|
39 - "{{pleroma_data_dir}}/{{pleroma_instance}}/uploads" |
|
40 - "{{pleroma_data_dir}}/{{pleroma_instance}}/static" |
|
41 - "{{pleroma_data_dir}}/{{pleroma_instance}}/static/emoji" |
|
42 |
|
43 # Set config path in systemd: PLEROMA_CONFIG_PATH |
|
44 |
|
45 # - name: install pleroma db schema file |
|
46 # template: |
|
47 # src: "setup_db.psql.j2" |
|
48 # dest: "/tmp/setup_db.psql" |
|
49 # owner: "{{pleroma_db_superuser}}" |
|
50 # group: "{{pleroma_db_superuser}}" |
|
51 # mode: "0700" |
|
52 # become: yes |
|
53 |
|
54 # - name: install pleroma psql |
|
55 # become: yes |
|
56 # become_user: "{{pleroma_db_superuser}}" |
|
57 # command: "psql -f /tmp/setup_db.psql" |
|
58 # notify: restart pleroma |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 # MIGERATION |
|
65 # mv ~pleroma/uploads/* /var/lib/pleroma/uploads |
|
66 # mv ~pleroma/instance/static /var/lib/pleroma/static |
|
67 # mv ~pleroma/priv/static/emoji /var/lib/pleroma/static/emoji |
|
68 # mv ~pleroma/config/prod.secret.exs /etc/pleroma/config.exs |
|
69 # Change `use Mix.Config` at the top to `import Config` |
|
70 # rm -r ~pleroma/* |
|
71 |
|
72 |
|
73 - name: download and unarchive pleroma release |
|
74 become: yes |
|
75 unarchive: |
|
76 src: "https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/{{pleroma_branch}}/download?job={{pleroma_flavor}}" |
|
77 dest: "/tmp/" |
|
78 remote_src: yes |
|
79 creates: "/tmp/release" |
|
80 notify: "restart pleroma {{pleroma_instance}} instance" |
|
81 |
|
82 - name: install pleroma release |
|
83 become: yes |
|
84 copy: remote_src="True" src="/tmp/release/" dest="/opt/pleroma/" |
|
85 |
|
86 # - name: Remove old files foo |
|
87 # file: path="/path/to/foo" state="absent" |
|
88 |
|
89 # *** |
|
90 # mv /tmp/release/* ~pleroma/ |
|
91 |
|
92 |
|
93 # Copy the service into a proper directory |
|
94 # cp ~pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service |
|
95 |
|
96 # - name: "configure pleroma systemd service" |
|
97 # become: yes |
|
98 # copy: |
|
99 # src: "[email protected]" |
|
100 # dest: "/lib/systemd/system/[email protected]" |
|
101 # notify: "restart pleroma {{pleroma_instance}} instance" |
|
102 |
|
103 # - name: "ensure pleroma {{pleroma_instance}} instance is enabled and started" |
|
104 # become: yes |
|
105 # systemd: name="pleroma@{{pleroma_instance}}" enabled="yes" state="started" |
|
106 |
|
107 # - name: migrate db |
|
108 # become: yes |
|
109 # become_user: "pleroma" |
|
110 # command: "/opt/pleroma/bin/pleroma_ctl migrate" |
|
111 # args: |
|
112 # chdir: "/opt/pleroma/" |
|
113 # notify: restart pleroma |