dotfile instead of env vars?

109 views
Skip to first unread message

Zo Obradovic

unread,
Oct 28, 2013, 2:50:04 PM10/28/13
to vagra...@googlegroups.com
Hi there, is there a way to set say, VAGRANT_CWD and VAGRANT_DEFAULT_PROVIDER in /etc or a dotfile instead via env vars?

thanks!

Fábio Rehm

unread,
Oct 29, 2013, 7:44:31 AM10/29/13
to vagra...@googlegroups.com
Hi Zo,

I've been experimenting with dotenv as a vagrant "plugin" and it has been working fine :)
I actually did a quick spike on making it a proper plugin but it required some crazy monkey patching like this in order to work properly so I put it on hold. I'm thinking how to better accommodate that from within Vagrant's core but I don't have anything ready for a pull request yet.

For now you can `vagrant plugin install dotenv` and add the code below at the top of your Vagrantfile:

```
begin
  require 'dotenv'
  Dotenv.load '.env.vagrant'
rescue LoadError; end
```

Hope it helps :)

Fábio Rehm

unread,
Oct 29, 2013, 7:45:36 AM10/29/13
to vagra...@googlegroups.com

Oh, and you can also try this out https://github.com/maoueh/nugrant
Reply all
Reply to author
Forward
0 new messages