From b11dbfc829a1e5b5779c7752614fba0e4eb951f0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 22 Dec 2020 15:53:03 +0000 Subject: [PATCH] Move traefik file provider to use directory rather than single file This makes future composition possible --- .../{file-provider.yml => file-provider-main.yml} | 0 ansible/roles/traefik/files/traefik.yml | 2 +- ansible/roles/traefik/tasks/main.yml | 13 ++++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) rename ansible/roles/traefik/files/{file-provider.yml => file-provider-main.yml} (100%) diff --git a/ansible/roles/traefik/files/file-provider.yml b/ansible/roles/traefik/files/file-provider-main.yml similarity index 100% rename from ansible/roles/traefik/files/file-provider.yml rename to ansible/roles/traefik/files/file-provider-main.yml diff --git a/ansible/roles/traefik/files/traefik.yml b/ansible/roles/traefik/files/traefik.yml index b259b35..ef62e46 100644 --- a/ansible/roles/traefik/files/traefik.yml +++ b/ansible/roles/traefik/files/traefik.yml @@ -25,7 +25,7 @@ providers: watch: true exposedByDefault: false file: - filename: /etc/traefik/file-provider.yml + directory: /etc/traefik/conf api: dashboard: true diff --git a/ansible/roles/traefik/tasks/main.yml b/ansible/roles/traefik/tasks/main.yml index 8587fa5..682a12f 100644 --- a/ansible/roles/traefik/tasks/main.yml +++ b/ansible/roles/traefik/tasks/main.yml @@ -8,7 +8,14 @@ - name: Create config directory file: - path: /opt/traefik/traefik + path: /opt/traefik/traefik/ + state: directory + mode: "{{ docker_compose_directory_mask }}" + become: true + +- name: Create file provider directory + file: + path: /opt/traefik/traefik/conf state: directory mode: "{{ docker_compose_directory_mask }}" become: true @@ -34,8 +41,8 @@ - name: Install file provider template: - src: files/file-provider.yml - dest: /opt/traefik/traefik/file-provider.yml + src: files/file-provider-main.yml + dest: /opt/traefik/traefik/conf/main.yml mode: "{{ docker_compose_file_mask }}" owner: "{{ docker_user.name }}" notify: restart traefik