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"