# Chef Infra — Configuration Management and Infrastructure Automation > A configuration management platform that automates how infrastructure is configured, deployed, and managed. Uses a Ruby-based DSL to define system state as code, ensuring consistency across thousands of nodes. ## Install Save as a script file and run: # Chef Infra — Configuration Management and Infrastructure Automation ## Quick Use ```bash # Install Chef Workstation curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef-workstation # Generate a cookbook chef generate cookbook my_webapp cd my_webapp # Apply locally chef-client --local-mode --runlist "recipe[my_webapp::default]" ``` ## Introduction Chef Infra is an infrastructure automation platform that turns system administration into code. It uses a declarative Ruby DSL to define the desired state of servers — packages installed, services running, files configured — and converges each node to that state automatically. Chef has been a foundational tool in the DevOps movement since 2009. ## What Chef Does - Defines infrastructure state using cookbooks, recipes, and resources written in Ruby - Converges nodes to the desired state idempotently on every run - Manages thousands of nodes from a central Chef Server or in local mode - Provides 100+ built-in resources for packages, files, services, users, and templates - Supports cross-platform automation for Linux, Windows, macOS, and network devices ## Architecture Overview Chef follows a client-server model. The Chef Server stores cookbooks, node data, and policies. Each managed node runs the Chef Client (chef-client), which pulls its run list from the server, compiles resources, and converges the system to the declared state. Chef Workstation is the developer tool for authoring and testing cookbooks. Cookbooks can be shared via Chef Supermarket, a public repository of community-maintained automation code. ## Self-Hosting & Configuration - Install Chef Workstation on your development machine for cookbook authoring - Set up Chef Server (or use Chef Infra in local mode for smaller environments) - Bootstrap nodes with ``knife bootstrap`` to install chef-client and register with the server - Organize infrastructure code into cookbooks with recipes, attributes, and templates - Use Test Kitchen and InSpec for testing cookbooks before deployment ## Key Features - Idempotent resource model ensures safe repeated runs without side effects - Policyfiles for versioned, reproducible cookbook dependency resolution - Chef Habitat integration for application packaging and runtime management - InSpec compliance framework for infrastructure testing and auditing - Extensive community cookbook ecosystem via Chef Supermarket ## Comparison with Similar Tools - **Ansible** — Agentless with YAML playbooks; Chef uses an agent and Ruby DSL with stronger convergence guarantees - **Puppet** — Declarative with its own language; Chef uses Ruby, giving more flexibility for complex logic - **SaltStack** — Event-driven with remote execution; Chef focuses on convergence-based configuration management - **Terraform** — Provisions infrastructure resources; Chef configures the software and services running on those resources ## FAQ **Q: Does Chef require an agent on every node?** A: Yes, chef-client runs on each managed node. It can run on a schedule (via cron or service) or be triggered on demand. **Q: Can I use Chef without a Chef Server?** A: Yes. Chef Zero (local mode) lets you run chef-client with cookbooks stored locally, suitable for smaller environments or testing. **Q: What language are cookbooks written in?** A: Cookbooks use a Ruby-based DSL for resource declarations. Custom resources and libraries can use full Ruby. **Q: Is Chef still actively maintained?** A: Yes. Chef Infra is maintained by Progress Software and continues to receive regular releases and security updates. ## Sources - https://github.com/chef/chef - https://docs.chef.io/chef_overview/ --- Source: https://tokrepo.com/en/workflows/b1336cf1-3b41-11f1-9bc6-00163e2b0d79 Author: Script Depot