1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# https://docs.pleroma.social/backend/installation/otp_en/
---
- hosts: ramble-hard
  become: true
  tasks:

    # Create the postgres database
    # su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql"
    - command: psql -f /tmp/setup_db.psql
      become_user: postgres

    # Create the database schema
    # su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
    - command: ./bin/pleroma_ctl migrate
      args:
        chdir: /opt/pleroma
      become_user: pleroma

    # If you have installed RUM indexes uncomment and run
    # su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
    # - command: ./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/
    #   args:
    #     chdir: /opt/pleroma
    #   become_user: pleroma

  handlers:
    - name: Restart postgres
      service:
        name: postgresql
        state: restarted