diff --git a/roles/traefik/defaults/main.yml b/roles/traefik/defaults/main.yml index b3ef50f..03bc851 100644 --- a/roles/traefik/defaults/main.yml +++ b/roles/traefik/defaults/main.yml @@ -2,3 +2,4 @@ traefik_name: traefik traefik_version: latest traefik_port: 8000 traefik_admin_port: 8080 +traefik_domain: localhost diff --git a/roles/traefik/tasks/main.yml b/roles/traefik/tasks/main.yml index 50a3d7f..fcacad8 100644 --- a/roles/traefik/tasks/main.yml +++ b/roles/traefik/tasks/main.yml @@ -1,5 +1,5 @@ - name: Install Traefik Configuration - copy: + template: src: traefik.yml dest: traefik.yml notify: Restart Traefik container diff --git a/roles/traefik/traefik.yml b/roles/traefik/traefik.yml index 69843c4..e312578 100644 --- a/roles/traefik/traefik.yml +++ b/roles/traefik/traefik.yml @@ -1,7 +1,7 @@ # Docker configuration backend providers: docker: - defaultRule: "Host(`{{ trimPrefix `/` .Name }}.docker.localhost`)" + defaultRule: "Host(`{{'{{'}} trimPrefix `/` .Name }}.{{ traefik_domain }}`)" # API and dashboard configuration api: