Chef is a configuration-management tool created by Adam Jacob and first released in 2009. It approaches system configuration as code, letting administrators describe the desired state of their infrastructure in programs that Chef then enforces on each managed machine. The engine and its libraries are developed in the open at github.com/chef/chef.
The fundamental unit of configuration in Chef is the recipe. The Chef documentation explains that a recipe “is the most fundamental configuration element,” that it “is authored using Ruby,” and that it “is mostly a collection of resources.” Because recipes are written in a real programming language, they can use loops, conditionals, and variables, giving Chef a more programmatic feel than tools built purely around a static description language.
Recipes are grouped into cookbooks. The documentation describes a cookbook as something that “defines a scenario and contains everything that is required to support that scenario,” including the recipes that specify which resources to use and the order in which they are applied, along with attribute values that allow environment-specific configuration such as development versus production. Cookbooks are the shareable, versionable packages of Chef configuration.
At the lowest level, Chef is built from resources. The documentation states that a resource “corresponds to some piece of infrastructure, such as a file, a template, or a package,” and that “each resource declares what state a part of the system should be in, but not how to get there.” This declarative core sits underneath Chef’s imperative Ruby surface: recipes are ordinary Ruby that assemble a list of desired-state resources, which Chef then converges.
Chef was a prominent early advocate of the phrase “infrastructure as code,” and along with Puppet it helped establish configuration management as a pillar of the DevOps movement. Its Ruby-DSL approach offered a distinct point on the spectrum between fully declarative systems and general-purpose scripting, and it shaped how a generation of teams thought about automating and versioning their server fleets.