pleroma/otp/tasks/instance.yaml
changeset 141 0708c9c075fc
child 143 7d4a477be685
equal deleted inserted replaced
140:f0da6c40158e 141:0708c9c075fc
       
     1 ---
       
     2 
       
     3 - name: install pleroma instance config
       
     4   template:
       
     5     src: "config.exs.j2"
       
     6     dest: "/etc/pleroma/{{pleroma_instance}}.config.exs"
       
     7     owner: "pleroma"
       
     8     group: "pleroma"
       
     9     mode: "0600"
       
    10   become: yes
       
    11   notify: restart pleroma instance
       
    12 
       
    13 - name: create instance data directory
       
    14   become: yes
       
    15   file:
       
    16     path: "{{item}}"
       
    17     state: "directory"
       
    18     owner: "pleroma"
       
    19     group: "pleroma"
       
    20     mode: "0755"
       
    21   with_items:
       
    22     - "{{pleroma_data_dir}}/{{pleroma_instance}}"
       
    23     - "{{pleroma_data_dir}}/{{pleroma_instance}}/uploads"
       
    24     - "{{pleroma_data_dir}}/{{pleroma_instance}}/static"
       
    25     - "{{pleroma_data_dir}}/{{pleroma_instance}}/static/emoji"
       
    26 
       
    27 - name: install pleroma db schema file
       
    28   become: yes
       
    29   template:
       
    30     src: "setup_db.psql.j2"
       
    31     dest: "/tmp/setup_db_{{pleroma_instance}}.psql"
       
    32     owner: "{{pleroma_db_superuser}}"
       
    33     group: "{{pleroma_db_superuser}}"
       
    34     mode: "0600"
       
    35 
       
    36 - name: install pleroma psql
       
    37   become: yes
       
    38   become_user: "{{pleroma_db_superuser}}"
       
    39   command: "psql -f /tmp/setup_db_{{pleroma_instance}}.psql"
       
    40   changed_when: false
       
    41 
       
    42 - include_tasks: soapbox.yaml
       
    43   when: pleroma_soapbox
       
    44 
       
    45 - name: ensure pleroma instance is enabled and started
       
    46   become: yes
       
    47   systemd: name="pleroma@{{pleroma_instance}}.service" enabled="yes" state="started"
       
    48 
       
    49 - name: migrate db
       
    50   become: yes
       
    51   become_user: "pleroma"
       
    52   command: "/opt/pleroma/bin/pleroma_ctl migrate"
       
    53   args:
       
    54     chdir: "/opt/pleroma/"
       
    55   environment:
       
    56     PLEROMA_CONFIG_PATH: "/etc/pleroma/{{pleroma_instance}}.config.exs"
       
    57   changed_when: false