I use Vagrant to deploy development virtual machines. One of the requirements is that the vagrant provision creates a new user (executed in the provisioning section of the script that I wrote), and then vagrant ssh connects to the mailbox as that user.
I cannot figure out how to determine if a field was provided or not.
I see that the backup Vagrant code clause sets env[:provision_enabled] if this run should be executed, so I thought I could do something like this:
if env[:provision_enabled] config.ssh.username = "#{data['ssh']['provision_username']}" else config.ssh.username = "#{data['ssh']['username']}" end
The idea is that SSH connections will use one connection for provisioning, and SSH connections for the rest will use another.
However, env[:provision_enabled] does not appear to be available in the Vagrantfile .
Is there any way to do this?
vagrant
Moshe katz
source share