Hi,
I have an ansible tasklist that generates a cfg file from a template first and then starts a docker container using that cfg file as a volume.
Works fine.
But when the generated cfg file changes (cfg file is actually generated from ansible inventory) , the docker container is not restarted, since from docker perspective nothing changed.Is there a way to 'force' ansible to restart the container under cetain conditions ?
Thanks,
Koen
Cfg:
---
- template: "src=members.conf.j2 dest={{ docker_host_dir }}/members.conf"
- name: balancer
docker:
name: balancer
image: <...>
state: reloaded
net: "{{ docker_net }}"
ports:
- "8000:8000"
volumes:
- "{{ docker_host_dir }}/members.conf:/usr/local/apache2/conf/members.conf"