How to restart docker containers with ansible?

842 views
Skip to first unread message

Dump Hole

unread,
Dec 17, 2015, 3:15:42 PM12/17/15
to Ansible Project
It seems the docker module for ansible is geared toward spinning up new containers, but not restarting an existing running container.

In command line, all you need is the container name.  It is as simple as
sudo docker stop <container_name>
sudo docker start <container_name>

But Ansible's docker requires 'image', which complicates things as now it has to remember all the settings how the container was first created.
Reply all
Reply to author
Forward
0 new messages