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
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:
After this change: