diff --git a/roles/traefik/handlers/main.yml b/roles/traefik/handlers/main.yml new file mode 100644 index 0000000..54f8a1f --- /dev/null +++ b/roles/traefik/handlers/main.yml @@ -0,0 +1,5 @@ +- name: Restart Traefik container + docker_container: + name: "{{ traefik_name }}" + image: traefik:{{ traefik_version }} + restart: true diff --git a/roles/traefik/tasks/main.yml b/roles/traefik/tasks/main.yml index 2f05fae..50a3d7f 100644 --- a/roles/traefik/tasks/main.yml +++ b/roles/traefik/tasks/main.yml @@ -2,11 +2,13 @@ copy: src: traefik.yml dest: traefik.yml + notify: Restart Traefik container - name: Start Traefik container docker_container: name: "{{ traefik_name }}" image: traefik:{{ traefik_version }} + state: started restart_policy: always ports: - "{{ traefik_port }}:80"