TT#8883 Add puppet repeat dialog for recovering from Git

Also fix an error when "repeat?" is being asked second time
after the successful re-run (we forgot to reset deploy status).

Change-Id: I621ed48d9eaeb620720d2d1ae4008485adfd346e
changes/56/11956/1
Alexander Lutay 8 years ago
parent 8b8a3391a3
commit bb5afae07d

@ -2228,6 +2228,9 @@ puppet_install_from_git () {
umount -f "${PUPPET_RESCUE_PATH}" umount -f "${PUPPET_RESCUE_PATH}"
rmdir "${PUPPET_RESCUE_PATH}" rmdir "${PUPPET_RESCUE_PATH}"
while $repeat ; do
repeat=false
echo "Initializing Hiera config..." echo "Initializing Hiera config..."
grml-chroot $TARGET puppet apply --test --modulepath="${PUPPET_CODE_PATH}/modules" \ grml-chroot $TARGET puppet apply --test --modulepath="${PUPPET_CODE_PATH}/modules" \
-e "include puppet::hiera" 2>&1 | tee -a /tmp/puppet.log -e "include puppet::hiera" 2>&1 | tee -a /tmp/puppet.log
@ -2243,6 +2246,23 @@ puppet_install_from_git () {
"${PUPPET_CODE_PATH}/manifests/site.pp" 2>&1 | tee -a /tmp/puppet.log "${PUPPET_CODE_PATH}/manifests/site.pp" 2>&1 | tee -a /tmp/puppet.log
check_puppet_rc "${PIPESTATUS[0]}" "2" check_puppet_rc "${PIPESTATUS[0]}" "2"
if ! checkBootParam nopuppetrepeat && [ "$(get_deploy_status)" = "error" ] ; then
echo "Do you want to [r]epeat puppet run? (Press any other key to continue without repeating.)"
read a
case "$a" in
r)
echo "Repeating puppet run."
repeat=true
set_deploy_status "puppet"
;;
*)
echo "Continue without repeating puppet run."
;;
esac
unset a
fi
done
# We want to keep the folder itself (because some day it may be 'production' env passed as pappetenv which # We want to keep the folder itself (because some day it may be 'production' env passed as pappetenv which
# folder should be existent for normal puppet server startup) but just delete all puppet code from there # folder should be existent for normal puppet server startup) but just delete all puppet code from there
echo "Cleanup content from '${TARGET}/${PUPPET_CODE_PATH}', while keeping the folder for further Puppet/r10k usage" echo "Cleanup content from '${TARGET}/${PUPPET_CODE_PATH}', while keeping the folder for further Puppet/r10k usage"
@ -2270,6 +2290,7 @@ puppet_install_from_puppet () {
r) r)
echo "Repeating puppet run." echo "Repeating puppet run."
repeat=true repeat=true
set_deploy_status "puppet"
;; ;;
*) *)
echo "Continue without repeating puppet run." echo "Continue without repeating puppet run."

Loading…
Cancel
Save