Skip to content

Instantly share code, notes, and snippets.

Created Apr 26, 2019
What would you like to do?
Run puppet during provisioning - puppet exit code > 1 on changes caused provisioning system to think it had failed
for (( i=0; i<5; i++ )); do
echo "Running Puppet Agent..."
/opt/puppetlabs/puppet/bin/puppet agent -t
if [ $rc = 0 ]; then
echo " *** SUCCESS!"
exit 0
elif [ $rc = 1 ]; then
>&2 echo " *** ERROR!"
exit 1
echo " *** Changes detected, will run again..."
>&2 echo "Puppet ran 5 times, but still seeing changes. You should look into this, but I am not exiting in error"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment