diff --git a/deployment.sh b/deployment.sh index 40ab803..3ac017c 100755 --- a/deployment.sh +++ b/deployment.sh @@ -2222,13 +2222,33 @@ puppet_install_from_git () { } puppet_install_from_puppet () { - echo "Running Puppet core deployment..." - grml-chroot $TARGET puppet agent --test --tags core,apt 2>&1 | tee -a /tmp/puppet.log - check_puppet_rc "${PIPESTATUS[0]}" "2" - - echo "Running Puppet deployment..." - grml-chroot $TARGET puppet agent --test 2>&1 | tee -a /tmp/puppet.log - check_puppet_rc "${PIPESTATUS[0]}" "2" + local repeat=true + + while $repeat ; do + echo "Running Puppet core deployment..." + grml-chroot $TARGET puppet agent --test --tags core,apt 2>&1 | tee -a /tmp/puppet.log + check_puppet_rc "${PIPESTATUS[0]}" "2" + + echo "Running Puppet deployment..." + grml-chroot $TARGET puppet agent --test 2>&1 | tee -a /tmp/puppet.log + 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 + ;; + *) + echo "Continue without repeating puppet run." + repeat=false + ;; + esac + unset a + fi + done } set_deploy_status "puppet"