From 8b93465483c3046af37cf5188249d025d51ac86c Mon Sep 17 00:00:00 2001 From: erebion Date: Fri, 15 Sep 2023 21:44:43 +0200 Subject: [PATCH] do not consider it an error if the containers cannot be stopped if they do not exist --- roles/authentik_docker/templates/authentik-db-docker.service.j2 | 2 +- .../templates/authentik-redis-docker.service.j2 | 2 +- .../templates/authentik-server-docker.service.j2 | 2 +- .../templates/authentik-worker-docker.service.j2 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/authentik_docker/templates/authentik-db-docker.service.j2 b/roles/authentik_docker/templates/authentik-db-docker.service.j2 index f4b0b5c..74d794c 100644 --- a/roles/authentik_docker/templates/authentik-db-docker.service.j2 +++ b/roles/authentik_docker/templates/authentik-db-docker.service.j2 @@ -9,7 +9,7 @@ ExecStart=/usr/bin/docker run --rm --name {{ container_names.authentik.db }} --n --env-file {{ docker_volumes_dir }}/authentik/authentik.env --expose 5432 \ -v {{ docker_volumes_dir }}/authentik/database:/var/lib/postgresql/data \ docker.io/library/postgres:{{ authentik_postgres_version }} -ExecStop=/usr/bin/docker stop {{ container_names.authentik.db }} +ExecStop=-/usr/bin/docker stop {{ container_names.authentik.db }} Restart=always RestartSec=30s TimeoutStartSec=30s diff --git a/roles/authentik_docker/templates/authentik-redis-docker.service.j2 b/roles/authentik_docker/templates/authentik-redis-docker.service.j2 index 329513c..29274a0 100644 --- a/roles/authentik_docker/templates/authentik-redis-docker.service.j2 +++ b/roles/authentik_docker/templates/authentik-redis-docker.service.j2 @@ -9,7 +9,7 @@ ExecStart=/usr/bin/docker run --rm --name {{ container_names.authentik.redis }} --network authentik_net --expose 6379 \ -v {{ docker_volumes_dir }}/authentik/redis:/data \ docker.io/library/redis:alpine --save 60 1 --loglevel warning -ExecStop=/usr/bin/docker stop {{ container_names.authentik.redis }} +ExecStop=-/usr/bin/docker stop {{ container_names.authentik.redis }} Restart=always RestartSec=15s Type=exec diff --git a/roles/authentik_docker/templates/authentik-server-docker.service.j2 b/roles/authentik_docker/templates/authentik-server-docker.service.j2 index 79cd721..bf2c513 100644 --- a/roles/authentik_docker/templates/authentik-server-docker.service.j2 +++ b/roles/authentik_docker/templates/authentik-server-docker.service.j2 @@ -12,7 +12,7 @@ ExecStart=/usr/bin/docker run --rm --name {{ container_names.authentik.server }} -v {{ docker_volumes_dir }}/authentik/custom-templates:/templates \ ghcr.io/goauthentik/server:{{ version.authentik }} server ExecStartPost=/usr/bin/bash -c "/bin/sleep 10 && /usr/bin/docker network connect nginx_net {{ container_names.authentik.server }}" -ExecStop=/usr/bin/docker stop {{ container_names.authentik.server }} +ExecStop=-/usr/bin/docker stop {{ container_names.authentik.server }} Restart=always RestartSec=60s TimeoutRestartSec=60s diff --git a/roles/authentik_docker/templates/authentik-worker-docker.service.j2 b/roles/authentik_docker/templates/authentik-worker-docker.service.j2 index 24207b3..b2323d4 100644 --- a/roles/authentik_docker/templates/authentik-worker-docker.service.j2 +++ b/roles/authentik_docker/templates/authentik-worker-docker.service.j2 @@ -14,7 +14,7 @@ ExecStart=/usr/bin/docker run --rm --name {{ container_names.authentik.worker }} -v {{ docker_volumes_dir }}/authentik/custom-templates:/templates \ ghcr.io/goauthentik/server:{{ version.authentik }} worker ExecStartPost=/usr/bin/bash -c "/bin/sleep 10 && /usr/bin/docker network connect nginx_net {{ container_names.authentik.worker }}" -ExecStop=/usr/bin/docker stop {{ container_names.authentik.worker }} +ExecStop=-/usr/bin/docker stop {{ container_names.authentik.worker }} Restart=always RestartSec=60s TimeoutRestartSec=60s