How to pass parameter on 'vagrant up' and have it in the scope of Vagrantfile?

Wojciech Bednarski picture Wojciech Bednarski · Jan 2, 2013 · Viewed 39.6k times · Source

I'm looking for a way to pass parameter to Chef cookbook like:

$ vagrant up some_parameter

And then use some_parameter inside one of the Chef cookbooks.

Answer

Draco Ater picture Draco Ater · Jan 2, 2013

You cannot pass any parameter to vagrant. The only way is to use environment variables

MY_VAR='my value' vagrant up

And use ENV['MY_VAR'] in recipe.