My understanding is if I have a playbook that says

- hosts:  localhost 
  sudo: yes
  tasks:
  - name: ensure redis container is running
    docker: image=dockerfile/redis name=redis command=" bash -c 
'redis-server  /etc/redis/redis.conf'"

  - name: ensure web container is running
    docker: image=snazzy/cyweb ports=5000:5000 links=redis:redis name=cyweb


Then if the image for cyweb gets updated with a new version shouldn't the 
ansible/docker module replace my container?

Even if I explicitly give it a tag. I tell it HERE, goto this version.

  - name: ensure redis container is running
    docker: image=dockerfile/redis name=redis command=" bash -c 
'redis-server  /etc/redis/redis.conf'"

  - name: Kill old container
    docker: image=snazzy/cyweb ports=5000:5000 links=redis:redis name=cyweb 
state=absent

  - name: ensure web container is running
*    docker: image=snazzy/cyweb:3.0* ports=5000:5000 links=redis:redis 
name=cyweb


It still does not update.

The only thing I found that works is if I kill the container first.

  - name: ensure redis container is running
    docker: image=dockerfile/redis name=redis command=" bash -c 
'redis-server  /etc/redis/redis.conf'"

*  - name: Kill old container*
*    docker: image=snazzy/cyweb ports=5000:5000 links=redis:redis 
name=cyweb state=absent*

  - name: ensure web container is running
    docker: image=snazzy/cyweb ports=5000:5000 links=redis:redis name=cyweb



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/544b3942-9a99-497d-91b5-3165440c1dc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to