Right now I have the following in my Vagrantfile:
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = \"cookbooks\"
chef.add_recipe \"apt\"
just a friendly reminder that adding all those recipes inside the vagrant provision can quickly become unmanageable.
A better pattern is to create a chef role chef/my-fancy-role.rb
# Name of the role should match the name of the file
name "my-fancy-role"
# Run list function we mentioned earlier
run_list(
"recipe[apt]",
"recipe[build-essential]",
"recipe[chef-redis::source]",
"recipe[openssl]"
)
And then add this role to the Vagrantfile
provisioning section:
config.vm.provision :chef_solo do |chef|
chef.roles_path = "chef/roles"
chef.cookbooks_path = ["chef/site-cookbooks", "chef/cookbooks"]
chef.add_role "my-fancy-role"
end