[ansible-project] How to restart docker containers with ansible?

2015-12-17 Thread Dump Hole
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 sudo docker start But Ansible's docker requires 'image', which complic

[ansible-project] How to check if previous shell task returns an empty string

2015-07-23 Thread Dump Hole
I have two shell tasks. The first one runs a check and returns a list of ids to be removed. The second one will remove these ids. The stdout of the first task looks like this: 1 2 3 4 which then gets fed into the second task to remove 1, 2, 3, 4 But if the first one cannot find ids to be remo