ansible/ansible-modules-core — pull request #316 by dkerwin (2014-11-13 17:47:22+00:00)
Title: Handle images with multiple tags

Scenario: Tags returned from docker and ansible may not always match
---

Single docker image has multiple tags associated (latest, prod, 456). Playbook looks like this:

```
tasks:
- name: stop old containers
local_action:
module: docker
docker_url: tcp://{{ facter_ipaddress_eth0 }}:2375
image: hub.example.com/base
state: stopped
- name: run container
local_action:
module: docker
docker_url: tcp://{{ facter_ipaddress_eth0 }}:2375
image: hub.example.com/base:prod
command: sleep 300
count: 3
state: running
```

Before the patch you end up with 3 new containers and the old containers would still be running. Docker will return the tag 456 (or one of the other tags) and the match in docker.py will fail. The patch will get all tags associated with the given image and return the correct list of containers.

Cheers :beers:
Daniel