I'm running Vagrant 1.8.5, which supports environment variables in the Vagrantfile at provisioning time using a format like this
config.vm.provision :shell, path: "bootstrap.sh", env: {"MYSQL_DB_USERNAME"=>"django", "MYSQL_DB_PASSWORD"=>"supersecretpasswordwasreplaced"}
However, I would like these environment variables to also be available when I do up
without provisioning, or when I SSH into the server to do jobs. The obvious ways I can find are
- to have them built into the box (seems like overkill) or
- repeat them in my
config.ssh.forward_env
so that they are available to both the provisioner and SSH.
Is there a better way?