I was wondering if it's possible to view (and parse) the vagrant log of the last (provision) run, to act upon specific output in that log?
In my use case, I have the following shell script:
#!/bin/sh
vagrant status | grep -q 'running'
if [ "$?" == '1' ]; then
vagrant up
exec vagrant snapshot take "${PWD##*/}-$(date +%s)"
fi
vagrant provision
if [ "$?" == '0' ]; then
sleep 1
exec vagrant snapshot take "${PWD##*/}-$(date +%s)"
else
exec vagrant snapshot back
fi
I'd like to be able to parse the provision log to see if any Chef recipe updated something on the node, if not, no new snapshot will be taken. (I use a Chef report handler to print this data in the Chef log output).
This shell script is being run on the host machine, so (to my knowledge) I don‘t have direct access to the Chef log output, other than through Vagrant’s log.
I was wondering if it's possible to view (and parse) the vagrant log of the last (provision) run
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.