pleroma/otp/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 19 Sep 2020 13:17:07 -0500
changeset 141 0708c9c075fc
parent 122 cde9702e3bff
child 143 7d4a477be685
permissions -rw-r--r--
Added proper reinstall logic for pleroma.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
141
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
     3
- name: add pleroma user
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
84
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
     5
  user: name="pleroma" shell="/bin/false" home="/opt/pleroma" system="yes"
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
101
bce4a3fd8da8 Added dep for ubuntu
Luke Hoersten <luke@hoersten.org>
parents: 98
diff changeset
     7
- name: apt install pleroma dependencies
bce4a3fd8da8 Added dep for ubuntu
Luke Hoersten <luke@hoersten.org>
parents: 98
diff changeset
     8
  become: yes
bce4a3fd8da8 Added dep for ubuntu
Luke Hoersten <luke@hoersten.org>
parents: 98
diff changeset
     9
  apt: name="libtinfo5"
bce4a3fd8da8 Added dep for ubuntu
Luke Hoersten <luke@hoersten.org>
parents: 98
diff changeset
    10
141
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    11
- name: create pleroma config and data directories
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
  become: yes
84
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    13
  file:
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    14
    path: "{{item}}"
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    15
    state: "directory"
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    16
    mode: "0755"
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    17
  with_items:
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    18
    - "{{pleroma_data_dir}}"
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    19
    - "/etc/pleroma"
85
dcfd23308c32 Completed pleroma-otp role.
Luke Hoersten <luke@hoersten.org>
parents: 84
diff changeset
    20
    - "/opt/pleroma"
60
48a3a65119d5 Initial commit.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
87
4f87097dd651 Got pleroma otp multi-instance working.
Luke Hoersten <luke@hoersten.org>
parents: 85
diff changeset
    22
- name: configure pleroma systemd service
85
dcfd23308c32 Completed pleroma-otp role.
Luke Hoersten <luke@hoersten.org>
parents: 84
diff changeset
    23
  become: yes
dcfd23308c32 Completed pleroma-otp role.
Luke Hoersten <luke@hoersten.org>
parents: 84
diff changeset
    24
  copy:
dcfd23308c32 Completed pleroma-otp role.
Luke Hoersten <luke@hoersten.org>
parents: 84
diff changeset
    25
    src: "[email protected]"
dcfd23308c32 Completed pleroma-otp role.
Luke Hoersten <luke@hoersten.org>
parents: 84
diff changeset
    26
    dest: "/lib/systemd/system/[email protected]"
dcfd23308c32 Completed pleroma-otp role.
Luke Hoersten <luke@hoersten.org>
parents: 84
diff changeset
    27
  notify: restart pleroma instance
84
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    28
141
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    29
- name: check if pleroma release exists
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    30
  stat: path="/tmp/release/"
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    31
  register: release
84
d0c40727e6ff Added WIP pleroma OTP role.
Luke Hoersten <luke@hoersten.org>
parents: 81
diff changeset
    32
141
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    33
- include_tasks: install.yaml
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    34
  when: not release.stat.exists
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    35
0708c9c075fc Added proper reinstall logic for pleroma.
Luke Hoersten <luke@hoersten.org>
parents: 122
diff changeset
    36
- include_tasks: instance.yaml