In Chef, individual program files are called Recipes. When you group multiple Recipe programs in an organized folder structure, we call that as Cookbook.
A chef code example looks like this:
- package apache2 do
- action :install
And you save it as a file named for example: apache.rb
.rb is the extension of a chef recipe file
To run this code, one can execute this command:
- chef-apply apache.rb
This execution will result into installation of apache software on the machine where the command is executed. (apache2 is the name of the package for apache software on ubuntu platform).