+++ title = "An Overview of Chef Infra" draft = false
aliases = ["/chef_overview.html"]
[menu] [menu.docs] title = "Chef Infra Overview" identifier = "chef_infra/getting_started/chef_overview.md Chef Infra Overview" parent = "chef_infra/getting_started" weight = 10 +++
{{% chef %}}
- Chef Workstation is the location where users interact with Chef Infra. With Chef Workstation, users can author and test cookbooks using tools such as Test Kitchen and interact with the Chef Infra Server using the knife and chef command line tools.
- Chef Infra Client nodes are the machines that are managed by Chef Infra. The Chef Infra Client is installed on each node and is used to configure the node to its desired state.
- Chef Infra Server acts as a hub for configuration data. Chef Infra Server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered node that is being managed by Chef. Nodes use the Chef Infra Client to ask the Chef Infra Server for configuration details, such as recipes, templates, and file distributions.
The following diagram shows the relationships between the various elements of Chef Infra, including the nodes, the server, and the workstation. These elements work together to provide the Chef Infra Client the information and instruction that it needs so that it can do its job. As you are reviewing the rest of this topic, use the icons in the tables to refer back to this image.
Chef Infra has the following major components:
Chef Infra Client run reporting, compliance reporting, high availability configurations, and Chef Infra Server replication are available as part of Chef Automate.
The following sections discuss these elements (and their various components) in more detail.
A workstation is your local computer running Chef Workstation that you use to author cookbooks, interact with the Chef Infra Server, and interact with nodes.
The workstation is where users do most of their work, including:
- Developing and testing cookbooks and recipes
- Testing Chef code
- Keeping the Chef repository synchronized with version source control
- Configuring organizational policy, including defining roles and environments, and ensuring that critical data is stored in data bags
- Interacting with nodes, as (or when) required, such as performing a bootstrap operation
Some important tools and components of Chef Workstation include:
{{% cookbooks_summary %}}
The Chef Infra Client uses Ruby as its reference language for creating cookbooks and defining recipes, with an extended DSL for specific resources. A reasonable set of resources are available to the Chef Infra Client, enough to support many of the most common infrastructure automation scenarios; however, this DSL can also be extended when additional resources and capabilities are required.
Cookbooks are comprised of the following components:
Component | Description |
---|---|
{{% cookbooks_attribute %}} | |
{{% resource_cookbook_file_summary %}} | |
{{% libraries_summary %}} | |
{{% cookbooks_metadata %}} | |
{{% cookbooks_recipe %}} The Chef Infra Client will run a recipe only when asked. When the Chef Infra Client runs the same recipe more than once, the results will be the same system state each time. When a recipe is run against a system, but nothing has changed on either the system or in the recipe, the Chef Infra Client won't change anything. {{% dsl_recipe_summary %}} |
|
{{% resources_common %}} Chef has many built-in resources that cover all of the most common actions across all of the most common platforms. You can build your own resources to handle any situation that isn't covered by a built-in resource. |
|
{{% template %}} | |
Testing cookbooks improves the quality of those cookbooks by ensuring they are doing what they are supposed to do and that they are authored in a consistent manner. Unit and integration testing validates the recipes in cookbooks. Syntax testing---often called linting---validates the quality of the code itself. The following tools are popular tools used for testing Chef recipes: Test Kitchen, ChefSpec, and Cookstyle. |
{{% node %}}
{{% node_types %}}
The key components of nodes that are under management by Chef include:
Component | Description |
---|---|
{{% chef_client_summary %}} {{% security_key_pairs_chef_client %}} |
|
{{% ohai_summary %}} |
{{% chef_server %}}
{{% policy_summary %}}
Some important aspects of policy include:
Feature | Description |
---|---|
{{% role %}} | |
{{% environment %}} | |
{{% cookbooks_version %}} | |
{{% node_run_list %}} |
Chef is a thin DSL (domain-specific language) built on top of Ruby. This approach allows Chef to provide just enough abstraction to make reasoning about your infrastructure easy. Chef includes a built-in taxonomy of all the basic resources one might configure on a system, plus a defined mechanism to extend that taxonomy using the full power of the Ruby language. Ruby was chosen because it provides the flexibility to use both the simple built-in taxonomy, as well as being able to handle any customization path your organization requires.