roles/pleroma/tasks/main.yaml
changeset 60 48a3a65119d5
child 62 63586cf10d46
equal deleted inserted replaced
-1:000000000000 60:48a3a65119d5
       
     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 
       
    15 - name: install extra apt packages
       
    16   become: yes
       
    17   apt: name="{{item}}"
       
    18   with_items:
       
    19     - "postgresql"
       
    20     - "esl-erlang"
       
    21     - "elixir"
       
    22     - "build-essential"
       
    23     - "git"
       
    24 
       
    25 - name: add users
       
    26   become: yes
       
    27   user: name="{{pleroma_user}}" shell="/bin/bash"
       
    28 
       
    29 - name: checkout plemora
       
    30   become: yes
       
    31   become_user: "{{pleroma_user}}"
       
    32   git:
       
    33     repo: "https://git.pleroma.social/pleroma/pleroma.git"
       
    34     dest: "~{{pleroma_user}}/pleroma"
       
    35     force: yes
       
    36 
       
    37 - name: update elixir dep
       
    38   become: yes
       
    39   become_user: "{{pleroma_user}}"
       
    40   lineinfile:
       
    41     path: "~{{pleroma_user}}/pleroma/mix.exs"
       
    42     regexp: 'elixir: "~> 1.4",$'
       
    43     line: 'elixir: "~> 1.7",'
       
    44 
       
    45 - name: install pleroma config files
       
    46   template:
       
    47     src: "{{item}}.j2"
       
    48     dest: "~{{pleroma_user}}/pleroma/config/{{item}}"
       
    49     owner: "{{pleroma_user}}"
       
    50     group: "{{pleroma_user}}"
       
    51     mode: "0775"
       
    52   become: yes
       
    53   become_user: "{{pleroma_user}}"
       
    54   with_items:
       
    55     - "setup_db.psql"
       
    56     - "dev.secret.exs"
       
    57 
       
    58 - name: install pleroma psql
       
    59   become: yes
       
    60   become_user: "postgres"
       
    61   command: "psql -f ~{{pleroma_user}}/pleroma/config/setup_db.psql"
       
    62 
       
    63 - name: migrate db
       
    64   become: yes
       
    65   become_user: "{{pleroma_user}}"
       
    66   command: "{{item}}"
       
    67   args:
       
    68     chdir: "~{{pleroma_user}}/pleroma/"
       
    69   with_items:
       
    70     - "mix local.hex --force"
       
    71     - "mix local.rebar --force"
       
    72     - "mix deps.get"
       
    73     - "mix ecto.migrate"
       
    74 
       
    75 - name: install pleroma systemd service
       
    76   template:
       
    77     src: "pleroma.service.j2"
       
    78     dest: "/lib/systemd/system/pleroma.service"
       
    79     owner: "{{pleroma_user}}"
       
    80     group: "{{pleroma_user}}"
       
    81     mode: "0770"
       
    82   become: yes
       
    83 
       
    84 - name: enable pleroma systemd service
       
    85   systemd: name="pleroma" enabled="yes" state="started"
       
    86   become: yes