Run puppet during provisioning - puppet exit code > 1 on changes caused provisioning system to think it had failed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for (( i=0; i<5; i++ )); do | |
echo "Running Puppet Agent..." | |
/opt/puppetlabs/puppet/bin/puppet agent -t | |
rc=$? | |
if [ $rc = 0 ]; then | |
echo " *** SUCCESS!" | |
exit 0 | |
elif [ $rc = 1 ]; then | |
>&2 echo " *** ERROR!" | |
exit 1 | |
else | |
echo " *** Changes detected, will run again..." | |
fi | |
done | |
>&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