ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 394 forks source link

Fix return code on refused Docker connection #964

Closed weisslj closed 5 years ago

weisslj commented 5 years ago
ISSUE TYPE
SUMMARY

If the connection to Docker is refused ansible-container prints an error but exits with 0 (= success). This leads to e.g. CI build jobs passing although they actually did not pass. This patch lets ansible-container fail with exit code 1 if the connection to Docker is refused.

Before this change:

$ sudo service docker stop
$ ansible-container build
ERROR   The connection to Docker was refused. Check your Docker environment configuration.
$ echo $?
0

After this change:

$ sudo service docker stop
$ ansible-container build
ERROR   The connection to Docker was refused. Check your Docker environment configuration.
$ echo $?
1