Added poa-blockscout service

This commit is contained in:
natalia 2018-09-20 18:47:42 -07:00
parent d3d92f4f59
commit ae68437341
3 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,3 @@
---
- name: restart poa-blockscout
service: name=poa-blockscout state=restarted

View File

@ -50,5 +50,10 @@
state: present
become: true
- name: Start server
shell: cd {{ home }}/blockscout && mix phx.server
- name: Install poa-blockscout service
template: src=poa-blockscout.j2 dest=/etc/systemd/system/poa-blockscout.service owner={{ username }} group={{ username }} mode=0755
notify:
- restart poa-blockscout
- name: Ensure poa-blockscout is running and enabled to start at boot
service: name=poa-blockscout state=started enabled=yes

View File

@ -0,0 +1,14 @@
[Unit]
Description=poa blockscout service
After=network.target
[Service]
User=root
Group=root
WorkingDirectory={{ home }}/blockscout
Restart=on-failure
RestartSec=5
ExecStartPre=/usr/local/bin/mix local.hex --force
ExecStart=/usr/local/bin/mix phx.server
Type=simple
[Install]
WantedBy=multi-user.target