Skip to content

Instantly share code, notes, and snippets.

@bodepd
Created July 9, 2015 03:52
Show Gist options
  • Save bodepd/1af9b3bbe6cc0eea7dfa to your computer and use it in GitHub Desktop.
Save bodepd/1af9b3bbe6cc0eea7dfa to your computer and use it in GitHub Desktop.
while true
do
# first install all packages to make the build as fast as possible
puppet apply --detailed-exitcodes \`puppet config print default_manifest\` --config_version='echo packages' --tags package
ret_code_package=\$?
# now perform base config
(echo 'File<| title == "/etc/consul" |> { purge => false }'; echo 'include rjil::jiocloud' ) | puppet apply --config_version='echo bootstrap' --detailed-exitcodes --debug
ret_code_jio=\$?
if [[ \$ret_code_jio = 1 || \$ret_code_jio = 4 || \$ret_code_jio = 6 || \$ret_code_package = 1 || \$ret_code_package = 4 || \$ret_code_package = 6 ]]
then
echo "Puppet failed. Will retry in 5 seconds"
sleep 5
else
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment