Is there a way to detect whether "up" or "provision" is run?

44 views
Skip to first unread message

sbrau...@gmail.com

unread,
Sep 18, 2015, 12:48:13 PM9/18/15
to Vagrant
I am setting up a vagrant testbed for our puppet repo. I want to pass no arguments to puppet_args on initial 'vagrant up' but pass '--test' on subsequent 'vagrant provision' as I would like to see the diffs of my changes. I don't want to see the diffs on initial provisioning because there's so much spam there... I just want to be able to verify that the changes I do produce the changes I think it should. Is this possible?

Stig

Alvaro Miranda Aguilera

unread,
Sep 18, 2015, 9:42:12 PM9/18/15
to vagra...@googlegroups.com
Hello,

This is very simple "but hey, it works!" ( c ) ( tm )

You can put something like this on your Vagrantfile

mypuppet_args =""
mypuppet_args ="--test" if ARGV[0] == "provision"

and use mypuppet_args as variable.

Alvaro.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/d58b9cf6-351d-4f7e-94b0-b870c0ec3dee%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

sbrau...@gmail.com

unread,
Sep 22, 2015, 6:58:28 AM9/22/15
to Vagrant
Thanks, this was exactly what I needed! :-)

Stig
Reply all
Reply to author
Forward
0 new messages