Catalog / Chef Automation Cheatsheet
Chef Automation Cheatsheet
A comprehensive cheat sheet for Chef, covering installation, basic usage, resources, and advanced configurations for infrastructure automation.
Installation & Setup
Chef Installation
Install Chef on your server using the following commands:
|
|
Verify the installation:
|
Setting Up a Cookbook
Download and extract a cookbook repository:
|
Knife Tool
Download cookbooks from the supermarket:
|
Basic Usage
Chef Solo Invocation
Run Chef Solo with a configuration file and JSON attributes:
|
solo.rb: Chef Solo configuration file. |
Key Chef Concepts
Resources |
Represent a desired state for a part of the system (e.g., a package, a file, a service). |
Recipes |
Collections of resources that define a configuration policy. |
Attributes |
Define specific settings and data used by resources. |
Cookbooks |
Packages that contain recipes, attributes, and other related files. |
Resource Examples
Compile From Source
|
|
Remote File Resource
|
Ruby Block
|
Execute Resource
|
Advanced Configuration
Resource Conditions
|
File Resource
|
Package Resource
|
Service Resource
|