Skip to content

Instantly share code, notes, and snippets.

@krisleech
Last active December 26, 2015 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisleech/7143310 to your computer and use it in GitHub Desktop.
Save krisleech/7143310 to your computer and use it in GitHub Desktop.
Share node config between chef-solo and Vagrant
vagrant_json = JSON.parse(Pathname(__FILE__).dirname.join('nodes', 'vagrant.json').read)
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["site-cookbooks", "cookbooks"]
chef.json.merge!(vagrant_json)
chef.add_recipe "default"
end
{
"deploy_user": "vagrant",
"deploy_home": "/home/vagrant"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment