Chef: create a directory for a template if it doesn’t already exist

Use the directory resource to create the directory before creating the template. The trick is to also specify the recursive attribute otherwise the action will fail unless all parts of the directory but the last exist already. config_dir = “#{node[:app][:deploy_to]}/#{node[:app][:name]}/shared/config” directory config_dir do owner node[:user][:username] group node[:user][:username] recursive true end template “#{config_dir}/database.yml” do source “database.yml.erb” … Read more

What are the benefits of running chef-server instead of chef-solo?

I am going to orient this answer as if the question was “what are the advantages of chef-solo” because that’s the best way I know to cover the differences between the approaches. My summary recommendation is in line with others: use a chef-server if you need to manage a dynamic, virtualized environment where you will … Read more