kayobe/tools/ansible-galaxy-retried.sh
Mark Goddard 7ed7b27bc4 Add retries to ansible galaxy install for all envs
Galaxy install often fails in CI, scuppering an otherwise good run.

Change-Id: I3d02afe33cdf32b1d285bd4bdc4a8074883113ca
2019-07-04 13:02:04 +00:00

16 lines
263 B
Bash
Executable File

#!/bin/bash
set -e
GALAXY_RETRIES=${GALAXY_RETRIES:-3}
for i in $(seq 1 $GALAXY_RETRIES); do
if ansible-galaxy "${@}"; then
exit 0
fi
echo "Ansible Galaxy command failed. Retrying"
done
echo "Failed to execute: ansible-galaxy ${@}"
exit 1