Replace docker-compose restart hack with shell handler hack

The docker-compose integration would start 2 of the same container, which does bad things to things like databases!
This commit is contained in:
Jake Howard
2020-06-28 20:13:12 +01:00
parent 71086ca291
commit 86a398d6b4
34 changed files with 112 additions and 271 deletions

View File

@ -0,0 +1,4 @@
- name: restart traefik
shell:
chdir: /opt/traefik
cmd: "{{ docker_update_command }}"

View File

@ -20,7 +20,7 @@
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: /usr/bin/docker-compose -f %s config
register: compose_file
notify: restart traefik
become: true
- name: Install config
@ -29,7 +29,7 @@
dest: /opt/traefik/traefik/traefik.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
register: config_file
notify: restart traefik
become: true
- name: Install file provider
@ -38,17 +38,5 @@
dest: /opt/traefik/traefik/file-provider.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
register: file_provider
notify: restart traefik
become: true
- name: Cycle container
docker_compose:
project_src: /opt/traefik
pull: true
remove_orphans: true
remove_volumes: true
state: "{{ item }}"
when: compose_file.changed or config_file.changed or file_provider.changed
loop:
- absent
- present