Chef Components:
1. Chef Infra Server:
Manages configuration data, policies, and metadata for nodes.
Data Store: Central repository storing cookbooks,
roles, environments, and node configurations.
Bookshelf: Stores binary files associated with
cookbooks.
2. Chef Workstation:
Development environment for creating and testing Chef
cookbooks.
Chef Development Kit (ChefDK): Toolkit containing
essential Chef development tools.
Cookbook Repository: Local storage for managing
and versioning cookbooks.
Test Kitchen: Tool for integration testing across
different platforms.
3. Cookbooks:
Collections of recipes and related resources defining desired
system configurations.
Recipes: Declarations of resources and their desired
states.
Attributes: Variables defining configurable properties
within recipes.
Libraries: Custom Ruby code extending cookbook
capabilities.
Templates: ERB files generating configuration files
dynamically.
4. Nodes:
Managed systems with defined configurations and run lists.
Attributes: Node-specific data defining characteristics
and configurations.
Run List: Ordered list of recipes and roles applied
during configuration runs.
Ohai: System profiling tool collecting node information
for configuration adaptation.
5. Knife:
Command-line tool for interacting with the Chef Infra Server.
Commands: CLI commands for managing nodes,
cookbooks, roles, and environments.
Plugins: Extendable framework adding custom
functionalities to Knife.
6. Chef Client:
Agent installed on nodes to apply configurations.
Chef Solo: Standalone version applying configurations
without a Chef Infra Server.
Ohai: Collects node information for accurate
configuration management.
Cookbooks:
A Chef cookbook is a fundamental unit of configuration in Chef Infra that
defines system configurations and desired states through recipes and
related resources.
Sub-Components:
1. Recipes:
Declarations of resources and their desired states (e.g.,
installing packages, configuring services).
Resources: Abstractions of system components (e.g.,
packages, files, services) managed by Chef.
Actions: Operations performed on resources (e.g.,
install, configure, restart).
2. Attributes:
Variables used to define configurable properties within
recipes.
Default Attributes: Default values defined within
cookbooks.
Override Attributes: Customizable values defined at
higher precedence levels (e.g., roles, environments).
3. Libraries:
Custom Ruby code extending cookbook capabilities and
providing reusable functionalities.
Custom Resources: User-defined abstractions of
system components with associated actions and
properties.
Helper Functions: Utility methods facilitating complex
logic within recipes.
4. Templates:
ERB (Embedded Ruby) files generating configuration files
dynamically based on variables and logic.
Variables: Data interpolated into templates during
rendering.
Conditional Logic: Control flow statements enabling
dynamic template generation.