mitchellh/vagrant — Issue #622: chef.json values from Vagrantfile not getting to dna.json
Author: bgreenlee
Created: 2012-01-04 22:09:26+00:00
State: open

I'm trying to pass some values to chef via `chef.json` in my `Vagrantfile`, and they aren't making it into `dna.json`. I'm following the documented pattern:

Vagrant::Config.run do |config|
config.vm.box = "centos57-64"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "chef/cookbooks"
chef.log_level = :debug
chef.add_recipe "twistle"
chef.json = { :subversion => {
:user => "brad",
:password => "sekret"
}}
end
end

I stepped through the code in the debugger, and dumped the `config` variable in `Vagrant::Provisioners::Chef#setup_json` (https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/provisioners/chef.rb#L58), and got: https://gist.github.com/24c1eb7dbef9217477c6

You can see (by searching for "sekret" that my data is buried in there, but it doesn't make it to `dna.json`. Here's what I get in `dna.json` (reformatted for clarity): https://gist.github.com/493c598c6cec3c4295a3

I'm running 0.8.10 on Lion (10.7.2). I've tried it under both ruby 1.9.3 and 1.8.7.