Conceptually, containers seem somewhere between applications and
hosts. Within the application case, let's think about services in
particular. You can specify to a module like yum to update a package
to a specific version. However, ansible doesn't ensure that the
service that is shipped with that package is restarted after the
update. Most of the time the package system itself will do that but
sometimes it won't (For instance, if the updated service needs new
data [changed config file format or old user entered data] and no
automatic data conversion is possible). In the latter case, you'd
have to specify a restart as a separate ansible task.
For hosts, a restart is definitely a separate task from an update.
You might install a new kernel version immediately upon release but
not want to restart the server until a scheduled outage window, for
instance.
Since it sounds like using docker manually would also require you to
first specify that the old container is shutdown and then that the new
container is created, I think that we probably want the same behaviour
from the ansible docker module (although we could have another
parameter that tells ansible to restart the container as well).
OTOH, I missed the fact that you had specified name in your playbook
before. Tracing through the code when that's specified, it looks like
the present code wants to destroy the old container and crate a new
one in that case; it's just buggy because it relies on the image's
symbolic name (which can be changed to reference a different image)
instead of its id.
So now I'm not sure if we should just fix this bug and then implement
a parameter that says "Do not restart the running container"...
-Toshio