#!/usr/bin/env bash set -eu set -o pipefail branch=${1:-main} (cd /usr/local/share/puppet-tozt && sudo git remote update && sudo git checkout -B "$branch" && sudo git submodule update --init --recursive && sudo git reset --hard "origin/$branch") set +e sudo puppet apply --show_diff --modulepath=/usr/local/share/puppet-tozt/modules --hiera_config=/usr/local/share/puppet-tozt/hiera/hiera.yaml --detailed-exitcodes /usr/local/share/puppet-tozt/manifests if [ $? -eq 2 ]; then exit 0 else exit $? fi