ansible/ansible-modules-core — pull request #123 by aaronfeng (2014-10-03 00:04:28+00:00)
Title: Restart Docker container when volumes, ports, or env vars have been changed

The current implementation only restarts the running container if the image:tag combo is different for named containers.

This PR will also restart the container if volumes, ports, and env vars do not match current state of Ansible. This is desirable for development for ease of restarting the containers while tweaking the parameters. It is also beneficial for production since those parameters can evolve over time.

I know this PR is also missing other potential important parameters such as links. I have no problem adding further support for other fields, but I want to make sure this will be accepted by upstream. With that said, I do think this PR provides value as it and other parameters can be part of another PR.