Add restart if traefik file edited
This commit is contained in:
parent
65e686409c
commit
924078fb3f
1 changed files with 11 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
backup: true
|
backup: true
|
||||||
src: .
|
src: .
|
||||||
dest: traefik/
|
dest: traefik/
|
||||||
|
register: traefik_copy_results
|
||||||
|
|
||||||
- name: Create proxy network
|
- name: Create proxy network
|
||||||
community.docker.docker_network:
|
community.docker.docker_network:
|
||||||
|
@ -12,9 +13,19 @@
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: Force update and restart container
|
||||||
|
community.docker.docker_compose:
|
||||||
|
project_src: traefik
|
||||||
|
state: present
|
||||||
|
pull: true
|
||||||
|
restarted: true
|
||||||
|
when: traefik_copy_results.changed
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Update or start container
|
- name: Update or start container
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: traefik
|
project_src: traefik
|
||||||
state: present
|
state: present
|
||||||
pull: true
|
pull: true
|
||||||
|
when: not traefik_copy_results.changed
|
||||||
become: true
|
become: true
|
Loading…
Reference in a new issue