Skip to content
Snippets Groups Projects
Commit 557f4f1a authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "CI: increase Ansible Galaxy retries & add delay"

parents e825e72c df00ba22
No related branches found
No related tags found
No related merge requests found
...@@ -225,13 +225,16 @@ function run_kayobe { ...@@ -225,13 +225,16 @@ function run_kayobe {
} }
function control_host_bootstrap { function control_host_bootstrap {
attempts=10
interval=5
echo "Bootstrapping the Ansible control host" echo "Bootstrapping the Ansible control host"
for i in $(seq 1 3); do for i in $(seq 1 $attempts); do
if run_kayobe control host bootstrap; then if run_kayobe control host bootstrap; then
chb_success=1 chb_success=1
break break
fi fi
echo "Control host bootstrap failed - likely Ansible Galaxy flakiness. Retrying" echo "Control host bootstrap failed - likely Ansible Galaxy flakiness. Sleeping $interval seconds before retrying"
sleep $interval
done done
if [[ -z ${chb_success+x} ]]; then if [[ -z ${chb_success+x} ]]; then
die $LINENO "Failed to bootstrap control host" die $LINENO "Failed to bootstrap control host"
...@@ -241,13 +244,16 @@ function control_host_bootstrap { ...@@ -241,13 +244,16 @@ function control_host_bootstrap {
} }
function control_host_upgrade { function control_host_upgrade {
attempts=10
interval=5
echo "Upgrading the Ansible control host" echo "Upgrading the Ansible control host"
for i in $(seq 1 3); do for i in $(seq 1 $attempts); do
if run_kayobe control host upgrade; then if run_kayobe control host upgrade; then
chu_success=1 chu_success=1
break break
fi fi
echo "Control host upgrade failed - likely Ansible Galaxy flakiness. Retrying" echo "Control host upgrade failed - likely Ansible Galaxy flakiness. Sleeping $interval seconds before retrying"
sleep $interval
done done
if [[ -z ${chu_success+x} ]]; then if [[ -z ${chu_success+x} ]]; then
die $LINENO "Failed to upgrade control host" die $LINENO "Failed to upgrade control host"
......
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
set -e set -e
GALAXY_RETRIES=${GALAXY_RETRIES:-3} GALAXY_RETRIES=${GALAXY_RETRIES:-10}
GALAXY_INTERVAL=${GALAXY_INTERVAL:-5}
for i in $(seq 1 $GALAXY_RETRIES); do for i in $(seq 1 $GALAXY_RETRIES); do
if ansible-galaxy "${@}"; then if ansible-galaxy "${@}"; then
exit 0 exit 0
fi fi
echo "Ansible Galaxy command failed. Retrying" echo "Ansible Galaxy command failed. Sleeping $GALAXY_INTERVAL seconds before retry"
sleep $GALAXY_INTERVAL
done done
echo "Failed to execute: ansible-galaxy ${@}" echo "Failed to execute: ansible-galaxy ${@}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment