diff --git a/docker-image/ansible/roles/traefik/tasks/main.yml b/docker-image/ansible/roles/traefik/tasks/main.yml index 3e5d6ea..3fd0e81 100644 --- a/docker-image/ansible/roles/traefik/tasks/main.yml +++ b/docker-image/ansible/roles/traefik/tasks/main.yml @@ -11,5 +11,7 @@ register: traefik_config_file_status - name: "Start traefik on the cluster" - when: traefik_stack_file_status.changed|bool or traefik_config_file_status.changed|bool + when: + - groups['edge'][0] == inventory_hostname + - traefik_stack_file_status.changed|bool or traefik_config_file_status.changed|bool shell: "docker stack deploy -c '{{ traefik_stack_file }}' {{ traefik_stack }}"