You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started to notice that a lot of people have been using environmental variables to make Vagrantfiles more dynamic so I was wondering if it would make sense to have this bundled on Vagrant's core instead of making a separate plugin for it.
As an example of usage, you can check Docker's Vagrantfile as they've been using it for setting things like base boxes names / URLs.
@mitchellh I did some testing with dotenv and it can give us a nice head start as it would be as simple as a adding a Dotenv.load during Vagrant's loading process:
$ vagrant plugin install dotenv
$ echo 'BOX_NAME=foo-bar' > .env
$ cat <<STR > Vagrantfile
Dotenv.load
puts "BOX_NAME is set to #{ENV['BOX_NAME']}"
STR
$ vagrant status
# outputs "BOX_NAME is set to foo-bar"
WDYT?
The text was updated successfully, but these errors were encountered:
Oh, I'd just suggest that we default to give preference to a .vagrant.env in favor of .env as some people might depend on a .env for foreman and it could confuse some folks ;)
Oh, that's fancy! I haven't used Packer's user variables before, I'm playing with Packer as of this writing and will see if I can think of something for Vagrant :)
I've started to notice that a lot of people have been using environmental variables to make
Vagrantfile
s more dynamic so I was wondering if it would make sense to have this bundled on Vagrant's core instead of making a separate plugin for it.As an example of usage, you can check Docker's Vagrantfile as they've been using it for setting things like base boxes names / URLs.
@mitchellh I did some testing with dotenv and it can give us a nice head start as it would be as simple as a adding a
Dotenv.load
during Vagrant's loading process:WDYT?
The text was updated successfully, but these errors were encountered: