Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayobe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kayobe
Commits
557f4f1a
Commit
557f4f1a
authored
4 years ago
by
Zuul
Committed by
Gerrit Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "CI: increase Ansible Galaxy retries & add delay"
parents
e825e72c
df00ba22
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dev/functions
+10
-4
10 additions, 4 deletions
dev/functions
tools/ansible-galaxy-retried.sh
+4
-2
4 additions, 2 deletions
tools/ansible-galaxy-retried.sh
with
14 additions
and
6 deletions
dev/functions
+
10
−
4
View file @
557f4f1a
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
tools/ansible-galaxy-retried.sh
+
4
−
2
View file @
557f4f1a
...
@@ -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
${
@
}
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment