A script to run vagrant provision and check for idempotency. You could use this on ansible-playbook commands too since it just parses the output in the recap. This was used successfully within an Azure Pipeline.
withinRecap=0
returnCode=2
while read line; do
echo "$line"
if [[ "$line" =~ PLAY\ RECAP\ \** ]]; then
withinRecap=1
fi