From 0ae3be7c42e0ea3551d5a2147ccc194f4965426b Mon Sep 17 00:00:00 2001 From: Lennard Brinkhaus Date: Mon, 18 Sep 2023 19:16:27 +0200 Subject: [PATCH] feat: add dashboard infos --- defaults/main.yml | 2 ++ templates/traefik.quadlet.j2 | 5 +++++ templates/traefik.yaml.j2 | 2 +- tests/test.yml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5760d3f..60a0b81 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,3 +3,5 @@ traefik_version_check: true traefik_version: "v2.10.4" traefik_yaml_acme_email: "" +traefik_dashboard: true +traefik_dashboard_url: "" diff --git a/templates/traefik.quadlet.j2 b/templates/traefik.quadlet.j2 index 5399cc4..c5d60e9 100644 --- a/templates/traefik.quadlet.j2 +++ b/templates/traefik.quadlet.j2 @@ -28,6 +28,11 @@ AddCapability=net_bind_service #SecurityLabelDisable=true PodmanArgs=--userns=keep-id --security-opt label=disable +Label="traefik.http.routers.dashboard.tls.certresolver=resolver" +Label="traefik.http.routers.dashboard.tls=true" +Label="traefik.http.routers.dashboard.rule=Host(`{{ traefik_dashboard_url }}`)" +Label="traefik.http.routers.dashboard.service=api@internal" + [Service] Restart=on-failure # Restart Delay diff --git a/templates/traefik.yaml.j2 b/templates/traefik.yaml.j2 index 5988b44..538a0f4 100644 --- a/templates/traefik.yaml.j2 +++ b/templates/traefik.yaml.j2 @@ -20,7 +20,7 @@ providers: # API and dashboard configuration api: # insecure: true - dashboard: true + dashboard: {{ traefik_dashboard }} certificatesResolvers: resolver: diff --git a/tests/test.yml b/tests/test.yml index f1ebf23..5ac0a5c 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,3 +5,4 @@ - role-traefik vars: traefik_yaml_acme_email: "test@localhost.intern" + traefik_dashboard_url: "test.intern"