This document summarizes an OSCON 2010 presentation by Joshua Timberman and Aaron Peterson of Opscode about Chef, an open-source automation platform for configuring and managing servers. The presentation covers Chef 101, getting started with Chef, and cooking with Chef. It discusses key concepts like Chef clients, the Chef server, nodes, roles, recipes, resources, attributes, and data bags. The goal is to provide an introduction to Chef and how it can be used to automate infrastructure.
8. At a High Level...
‣ A library for configuration management
‣ A configuration management system
‣ A systems integration platform
‣ An API for your entire Infrastructure
http://www.flickr.com/photos/asten/2159525309/sizes/l/
38. Resources...
Declare a description of the state a part of the node should be in
‣ Have a type package "apache2" do
version "2.2.11-2ubuntu2.6"
action :install
‣ Have a name end
template "/etc/apache2/apache2.conf" do
‣ Have parameters source "apache2.conf.erb"
owner "root"
‣ Take action to put the group "root"
mode 0644
resource in the action :create
declared state end
40. Providers...
Know how to actually perform the actions specified by a resource.
Apt, Yum, Rubygems,
Multiple providers
per resource type.
Portage, Macports,
FreeBSD Ports, etc.
Can be
overridden with package "apache2" do
provider "Chef::Provider::Package::Dpkg"
the provider action :install
parameter on a end
resource.
http://www.flickr.com/photos/affableslinky/562950216/
44. Recipes...
Apply resources in the order they are specified
package "apache2" do
version "2.2.11-2ubuntu2.6"
action :install
1
‣ Evaluates resources in [
end
1
the order they appear "package[apache2]",
"template[/etc/apache2/apache2.conf]"
template "/etc/apache2/apache2.conf" do
2
] source "apache2.conf.erb"
‣ Adds each resource to owner "root"
the Resource Collection group "root"
mode 0644
action :create
2
end
http://www.flickr.com/photos/roadsidepictures/2478953342/sizes/o/