Skip to content

Uploading the dummy cookbooks

pikesley edited this page Apr 8, 2012 · 5 revisions

There are some dummy cookbooks in the chef-repo, we can upload them to the server with

cd chef-repo
rake upload_cookbooks

and we should now see them here.

Let's try one out, then. The default recipe in the the_royal_scam cookbook is about as simple as it gets:

file "/home/vagrant/the_caves_of_altimira" do
  owner "root"
  group "root"
  mode "0755"
  action :create
end

So we can add it to the run_list for our node with

knife node run list add doctorwu "recipe[the_royal_scam]"

Then jump on the node and run

sudo chef-client

And it's created that file for us:

ls /home/vagrant/
postinstall.sh  the_caves_of_altimira

Our first little bit of actual Chef! So now we can move on to the exercises.