What is Chef
Chef is an automation platform that “turns infrastructure into code,” . Its a powerful configuration management system that can be used to programmatically control your infrastructure environment. Chef is a popular configuration management system that allows you to deploy predictable, complex environments to machines within your organization.
Chef Server
The Chef Server acts as a central repository for cookbooks as well as for information about every node it manages.
There are three types of chef server available.
- Chef Solo: Actually chef solo is not a chef server. In fact it removes the need of having a central chef server to test configurations on nodes.
- Open Source Chef: This is completely free and open source chef, which you can install anywhere.
- Hosted Chef: This is a paid, where opscode will manage your central chef server, which you can access/configure using the web interface. This makes you free from the responsibility of managing a central chef server yourself.
Chef Workstation
This machine holds all the configuration data that can later be pushed to the central chef server. Several chef command line utilities will be available in the system, which can be used to interact with nodes, update configurations etc. This is a place from which most of the work happens on a day to day basis. Chef DK is installed on the workstation
Workstation will have two main components
- Knife Utility: Its a Command Line Tool used to communicate with the central chef server from workstation. Adding, removing, changing configurations, of nodes in central chef server will be carried out by using this knife utility
- A Local Chef Repository: This is a place where every configuration components of chef server is stored. This chef repository can be synchronized with the chef central server (using knife).
Chef Client & Node
A node is any physical or virtual machine in your network that is managed by the Chef server. The Chef client is a piece of software that runs on each node and securely communicates with the Chef server to get the latest configuration instructions. The Chef client uses the instructions to bring the node to its desired state. It uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources.
Chef Development Kit
This is installed on your workstation. The ChefDK gives you the tools you need to develop and test your infrastructure automation code locally from your workstation, before deploying changes into production.Chef DK also includes InSpec, a powerful language for writing infrastructure tests.
Cookbook
A cookbook is the fundamental unit of configuration and policy distribution in Chef. A cookbook defines a scenario and contains everything that is required to support that scenario:
- Recipes: A recipe is the most fundamental configuration element within the organization. Its a collection of resources. It is stored in a cookbook.
- Attribute values: An attribute can be defined in a cookbook (or a recipe) and then used to override the default settings on a node.
- File distributions: A file distribution is a specific type of resource that tells a cookbook how to distribute files, including by node, by platform, or by file version.
- Templates: A template is a file written in markup language that uses Ruby statements to solve complex configuration scenarios.
- Definitions: A definition is used to create new resources by stringing together one (or more) existing resources.
- Libraries: A library allows the use of arbitrary Ruby code in a cookbook, either as a way to extend the chef-client language or to implement a new class.
- Custom Resources: A custom resource is an abstract approach for defining a set of actions and (for each action) a set of properties and validation parameter
- Metadata: A metadata file is used to ensure that each cookbook is correctly deployed to each node.
- Resources:A resource instructs the chef-client to complete various tasks like installing packages, running Ruby code, or accessing directories and file systems. The chef-client includes built-in resources that cover many common scenarios. For the full list of resources that are built-in to the chef-client, see /resources.html.

