nostr/relayer/tasks/main.yaml
changeset 217 e69a030975c4
parent 214 3069b7d001f7
child 237 c6c11084c802
equal deleted inserted replaced
216:6c85835d4621 217:e69a030975c4
       
     1 ---
       
     2 
       
     3 - name: add relayer user
       
     4   become: yes
       
     5   user: name="{{relayer_user}}" shell="/bin/false" create_home="false" system="yes"
       
     6 
       
     7 - name: install relayer systemd service
       
     8   become: yes
       
     9   copy:
       
    10     src: "relayer.service"
       
    11     dest: "/lib/systemd/system/relayer.service"
       
    12   notify: restart relayer service
       
    13 
       
    14 - name: install relayer bin
       
    15   become: yes
       
    16   get_url:
       
    17     url: "{{relayer_bin_url}}"
       
    18     dest: "/usr/local/bin/relayer"
       
    19     owner: "root"
       
    20     group: "root"
       
    21     mode: "0755"
       
    22   notify: restart relayer service
       
    23 
       
    24 - name: create relayer dirs
       
    25   become: yes
       
    26   file:
       
    27     path: "/etc/relayer"
       
    28     owner: "root"
       
    29     group: "root"
       
    30     mode: "0755"
       
    31     state: "directory"
       
    32 
       
    33 - name: install relayer config
       
    34   become: yes
       
    35   template:
       
    36     src: "relayer.env.j2"
       
    37     dest: "/etc/relayer/relayer.env"
       
    38     owner: "root"
       
    39     group: "root"
       
    40     mode: "0600"
       
    41   notify: restart relayer service
       
    42 
       
    43 - name: copy db schema file
       
    44   become: yes
       
    45   template:
       
    46     src: "setup_db.psql.j2"
       
    47     dest: "/tmp/setup_db_relayer.psql"
       
    48     owner: "postgres"
       
    49     group: "postgres"
       
    50     mode: "0600"
       
    51 
       
    52 - name: install db schema psql
       
    53   become: yes
       
    54   become_user: "postgres"
       
    55   command: "psql -f /tmp/setup_db_relayer.psql"
       
    56   changed_when: false
       
    57 
       
    58 - name: ensure service is started
       
    59   become: yes
       
    60   systemd: name="relayer.service" enabled="yes" state="started"