I'm struggling to understand how to pass current vagrant configuration to chef.
For example during Vagrant provisioning I have this configuration:
config.vm.provider :aws do |aws, override|
override.ssh.username = "ubuntu"
...
end
...
config.vm.provision :chef_solo do |chef|
chef.json = {
username: "ubuntu"
}
...
end
Now how can I reuse the ssh username in chef-solo provisioning? I would like be able to write something like this:
config.vm.provision :chef_solo do |chef|
chef.json = {
username: config.ssh.username
}
end
Any help highly appreciated :)