From bec78de2f3b64b338f1cf31950e6be0cab93692b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 24 Aug 2023 22:42:38 +0300 Subject: [PATCH] Deploy godoor from Docker image --- ansible-doors.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ansible-doors.yml b/ansible-doors.yml index 5b49a78..c641cb0 100644 --- a/ansible-doors.yml +++ b/ansible-doors.yml @@ -41,17 +41,19 @@ [Unit] Description=Doorboy service Documentation=https://git.k-space.ee/k-space/godoor + After=network.target [Service] - EnvironmentFile=/etc/godoor - Environment=KDOORPI_API_ALLOWED=https://doorboy-proxy.k-space.ee/allowed - Environment=KDOORPI_API_LONGPOLL=https://doorboy-proxy.k-space.ee/longpoll - Environment=KDOORPI_API_SWIPE=https://inventory.k-space.ee/swipes - Environment=KDOORPI_DOOR=%H - ExecStart=/usr/local/bin/godoor - User=root - Restart=always + Environment=IMAGE=harbor.k-space.ee/k-space/godoor:latest + ExecStartPre=-ctr task kill --signal=9 %N + ExecStartPre=-ctr task rm %N + ExecStartPre=-ctr c rm %N + ExecStartPre=ctr image pull $IMAGE + ExecStart=ctr run --rm --pid-file=/run/%N.pid --privileged --read-only --env-file=/etc/godoor --env=KDOORPI_API_ALLOWED=https://doorboy-proxy.k-space.ee/allowed --env=KDOORPI_API_LONGPOLL=https://doorboy-proxy.k-space.ee/longpoll --env=KDOORPI_API_SWIPE=https://doorboy-proxy.k-space.ee/swipe --env=KDOORPI_DOOR=%H --net-host --net-host --cwd /app $IMAGE %N /godoor + ExecStopPost=ctr task rm %N + ExecStopPost=ctr c rm %N [Install] WantedBy=multi-user.target + Restart=always - name: Enable Doorboy controller ansible.builtin.systemd: state: restarted