From 4a5c245128be6ca62f0a6d458df7bf0f5a316eba Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Thu, 20 Aug 2020 23:31:07 +0200 Subject: [PATCH] traefik: Remove file provider config options when omitted Currently there is an ugly error message when traefik tries to read the dynamic_conf directory while it doesn't exists, because no dynamic config is definied. This patch makes the config, given that it's not defined truely optional and gets rid of the error message. --- roles/traefik/templates/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/traefik/templates/docker-compose.yml b/roles/traefik/templates/docker-compose.yml index 325f146..2f21293 100644 --- a/roles/traefik/templates/docker-compose.yml +++ b/roles/traefik/templates/docker-compose.yml @@ -105,8 +105,10 @@ services: - "--entryPoints.web.address=:80" - "--entryPoints.websecure.address=:443" - "--accesslog={{ traefik_access_log_enabled | bool | lower }}" +{% if traefik_dynamic_conf != omit %} - "--providers.file.directory=/etc/traefik/dynamic_conf" - "--providers.file.watch=true" +{% endif %} - "--providers.docker=true" - "--providers.docker.endpoint=tcp://dockersocket:2375" - "--providers.docker.exposedByDefault=false"