Course contentsShow
← Software Engineering
Lesson 1491 of 1,93343. Infrastructure as CodeFree lesson

Chef and Puppet Models

Understanding client-server configuration management with Chef cookbooks and Puppet manifests.

Chef and Puppet Models

You'll learn how Chef and Puppet enforce configuration through client-server architectures using declarative specifications.

The Client-Server Configuration Model

While Ansible operates agentless (pushing configurations directly), Chef and Puppet use a client-server model where agents run on managed nodes and periodically pull configurations from a central server. Think of it like a classroom where students (nodes) regularly check a bulletin board (server) for updated instructions rather than waiting for the teacher to personally visit each desk.

Chef: Cookbooks and Convergence

Chef organizes infrastructure code into cookbooks—collections of recipes that describe the desired state of resources. Each managed node runs a Chef client that:

  • Pulls the latest configuration from the Chef server
  • Compares current state with desired state
  • Executes necessary changes to "converge" toward the target

Chef uses Ruby-based DSL and treats configuration as procedural code that's executed in order, giving you fine-grained control over the sequence of operations.

Puppet: Manifests and Catalog Compilation

Puppet defines infrastructure using manifests—declarative files describing resource states. The workflow operates through:

  • Puppet master compiles manifests into a catalog (a complete description of desired state)
  • Puppet agents on nodes request their catalog
  • Agents apply the catalog, making only necessary changes
  • Agents report status back to the master

Puppet's declarative model focuses on what the end state should be, not how to achieve it. The Puppet engine determines the execution order based on resource dependencies.

Key Differences

Both require agent installation and maintain persistent infrastructure, but Chef's procedural approach offers more flexibility while Puppet's pure declarative model emphasizes predictability and dependency management.

Key Takeaway: Chef and Puppet use agent-based client-server architectures where nodes periodically pull configurations—Chef through procedural cookbooks and Puppet through declarative manifests—enabling centralized, automated infrastructure management at scale.