diff --git a/roles/shellserver/odderon/files/odderon.service b/roles/shellserver/odderon/files/odderon.service new file mode 100644 --- /dev/null +++ b/roles/shellserver/odderon/files/odderon.service @@ -0,0 +1,13 @@ +[Unit] +Description=Odderon darkbot + +[Service] +User=odderon + +Type=Simple +ExecStart=/opt/odderon/bin/darkbot +ExecReload= kill -HUP `cat /opt/odderon/darkbot.pid` +PIDFile=/opt/odderon/darkbot.pid + +[Install] +WantedBy=multi-user.target diff --git a/roles/shellserver/odderon/init.sls b/roles/shellserver/odderon/init.sls --- a/roles/shellserver/odderon/init.sls +++ b/roles/shellserver/odderon/init.sls @@ -9,3 +9,4 @@ include: - .account - .code + - .service diff --git a/roles/shellserver/odderon/service.sls b/roles/shellserver/odderon/service.sls new file mode 100644 --- /dev/null +++ b/roles/shellserver/odderon/service.sls @@ -0,0 +1,28 @@ +# ------------------------------------------------------------- +# Salt — Deploy Odderon unit (darkbot) +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Project: Nasqueron +# Created: 2017-01-25 +# Description: Darkbot unit (Freenode) +# License: Trivial work, not eligible to copyright +# ------------------------------------------------------------- + +# ------------------------------------------------------------- +# Unit configuration +# ------------------------------------------------------------- + +odderon_unit: + file.managed: + - name: /etc/systemd/system/odderon.service + - source: salt://roles/shellserver/odderon/files/odderon.service + - mode: 0644 + module.run: + - name: service.systemctl_reload + - onchanges: + - file: odderon + +odderon_running: + service.running: + - name: Odderon darkbot + - watch: + - module: odderon