Get a hands-on introduction to the Chef, the configuration management tool for solving operations issues in enterprises large and small. Ideal for developers and sysadmins new to configuration management, this guide shows you to automate the packaging and delivery of applications in your infrastructure. You’ll be able to build (or rebuild) your infrastructure’s application stack in minutes or hours, rather than days or weeks.
After teaching you how to write Ruby-based Chef code, this book walks you through different Chef tools and configuration management concepts in each chapter, using detailed examples throughout. All you need to get started is command-line experience and familiarity with basic system administration.
Configure your Chef development environment and start writing recipes
Create Chef cookbooks with recipes for each part of your infrastructure
Use Test Kitchen to manage sandbox testing environments
Manage single nodes with Chef client, and multiple nodes with Chef Server
Use data bags for storing shared global data between nodes
Simulate production Chef Server environments with Chef Zero
Classify different types of services in your infrastructure with roles
Model life stages of your application, including development, testing, staging, and production
Chapter 1Configuration Management and Chef
What Is Configuration Management?
Why You Need a Configuration Management Tool to Automate IT
What Is Chef?
Why Chef Might Be a Good Tool for Your Enterprise
Where Do We Go From Here?
Chapter 2Configure Your Chef Development Environment
Install a Programmer’s Text Editor
Chef Development Tools
Install the Chef Development Tools on Linux
Install the Chef Development Tools on Mac OS X
Install the Chef Development Tools on Windows
Chapter 3Ruby and Chef Syntax
Overview of Ruby
Ruby Syntax and Examples
Chef Syntax and Examples
Chapter 4Write Your First Chef Recipe
Create a Directory Structure for Your Code
Write Your First Chef Recipe
Verify Your First Chef Recipe
Recipes Specify Desired Configuration
To Uninstall, Specify What Not to Do
Chapter 5Manage Sandbox Environments with Test Kitchen
Installing Vagrant and VirtualBox
Host versus Guest
Introducing Test Kitchen
Spinning Up Your First Virtual Machine
Test Kitchen Configuration with .kitchen.yml
Chapter 6Manage Nodes with Chef Client
What Is a Node?
Create a New Sandbox Environment for a Node
Installing Chef Client with Test Kitchen
Your First Chef-Client Run
Chef Client Modes
Accessing Node Information
Chapter 7Cookbook Authoring and Use
Your First Cookbook: Message of the Day
Your First Cookbook: Message of the Day (Chef Development Kit)
Introducing the Cookbook_file Resource
Your First Cookbook: Message of the Day (Chef Client)
Introducing the Cookbook_file Resource
Performing Your First Converge
Validate Your Results
Anatomy of a Chef Run
The Four Resources You Need to Know
Apache Cookbook: A Step-By-Step Primer for Creating a Cookbook
Basic Attribute Priority
Chapter 9Manage Multiple Nodes at Once with Chef Server
How to Install Enterprise Chef Server Manually
Install Enterprise Chef Server
Configure Enterprise Chef Server
Testing the Connection
Bootstrapping a Node
Bootstrap Chef Server with Chef Solo
Chapter 10Community and the Chef-Client Cookbook
Using Community Cookbooks
Knife Cookbook Site Plugin
Search for Community Cookbooks Using Knife Cookbook Site
Manage Chef Supermarket Cookbooks on Your Chef Server Using Knife Cookbook Site
Configure Knife to Use a Production SSL Setup
Configure Chef-Client to Use a Production SSL Setup
Chapter 11Chef Zero
Test Kitchen and Chef Zero
Running Chef-Zero on Your Host Using Chef-Playground
Search from the Command Line
Search from the Command Line with Knife
Search in a Recipe Using Test Kitchen
Chapter 13Data Bags
Basic Command Line Data Bag Usage with Knife
Creating Local Users Based on Data Bag Items in a Recipe
Mischa Taylor is a consultant at Chef, a fast-growing Seattle-based startup responsible for creating the Chef platform, which makes it easy to quickly automate development processes and move business processes into the cloud. He has spent his career focusing on building high quality products and increasing engineering productivity within organizations. Mischa is an author, speaker and mentor on software development topics and neuromorphic computing.
Seth is currently a software engineer and open source advocate at at HashiCorp. Previously, Seth worked at Chef (Opscode), CustomInk, and a few Pittsburgh-based startups. He is passionate about inequality in technology and organizational culture. When he is not writing software or working on open source, Seth enjoys speaking at local user groups and conferences. He is a co-organizer for DevOps Days Pittsburgh and loves all things bacon. You can find him on the Internet as @sethvargo or at https://sethvargo.com.
The animal on the cover of Learning Chef is a Wahlberg's honeyguide, also known as a brown-backed honeybird (Protodiscus regulus).
The Wahlberg's honeyguide is a small bird native to the thornveld and other mesic habitats of southern Africa. Inconspicuous and mostly residential, the honeyguide feeds primarily on scale insects and practices brood parasitism, in which offspring are smuggled into the broods of other birds—in this case, into the spherical nests of cisticolas and warblers—in order to spare the brood-parasite the investment of raising young.
This bird was given its name by Johan August Wahlberg, a Swedish naturalist who, during his travels in southern Africa between 1838 and 1856, also gave his name to a species of eagle, cormorant, fruit bat, frog, and tree. Wahlberg met his end near the Thamalakane river in modern-day Botswana in 1856, trampled by a wounded elephant. Wahlberg's subsequent election to the Royal Swedish Academy of Science before news of his death could reach Sweden makes him the only member to have been elected posthumously.
Many of the animals on O'Reilly covers are endangered; all of them are important to the world. To learn more about how you can help, go to animals.oreilly.com.
The cover image is from Cassell's Natural History. The cover fonts are URW Typewriter and Guardian Sans. The text font is Adobe Minion Pro; the heading font is Adobe Myriad Condensed; and the code font is Dalton Maag's Ubuntu Mono.
Chef is a pretty whiz-bang, "how did I ever manage servers without this?" product. But like all complex systems, if you don't know the theory and design decisions behind it, Chef can be pretty hard to debug, especially when you're starting out.
Learning Chef strikes a really good balance between "this is what you do" and "this is why you do it." I was able to follow the examples well AND get myself out of trouble. Then when I confronted our real-world Chef server at work, I was surprised at how much I understood.
Bottom Line Yes, I would recommend this to a friend
I have read and tried the examples of the first seven chapters in the book. The instruction on setting up the environment and examples are clear and easy to follow.
The authors have done a good job in explaining the concept in Chef. The chapter in Ruby has good coverage of the parts of Ruby that are relevant in Chef. As I did not know any Ruby, I found it very useful.
Bottom Line Yes, I would recommend this to a friend
Day job uses Chef to manage several hundred nodes. If they would have asked me, I would have recommended SaltStack, but they didn't so I needed to get up to speed on Chef in a hurry. Online Chef docs leave much to be desired (big $ support contracts anyone??). And pretty much all the other Chef books out there suck or are mediocre at best so this preview release seemed timely and worth taking a chance. Glad I got it 50% off because it has a long ways to go before becoming useful as anything other than base primer targeting novice to junior level sysadmins.
Book is a follow along, tutorial format that mandates use of author's favorite toolsets. I don't like the vendor lockin. There are other options for running virtual machines other than VirtualBox. Probably all of which are in wider use, e.g. VMware, various cloud providers, SmartOS, etc. Yeah, I know Virtual Box is free and favored by winweenies, but us *nix geeks prefer to keep our options open and eschew software from companies run by major jerks, even if it is free (e.g. many Linux distros have replaced MySQL with MariaDB). So it would be nice if this book talked at least a bit about them. Also no mention of things like rvm.io for managing Ruby virtual env. Perhaps I make much ado about nothing but it just put me off and left a bad taste in my mouth right out of the gate.
The book is also too basic. Just because I'm just learning Chef, doesn't mean that I am not interested in advanced features. Indeed, it's the advanced stuff that most warrants/requires explanation. So where's the beef? As it stands now, the Appendices are the most valuable parts, if you can get past the typos. Speaking of which....
Learning Chef is full of typos & grammar errors. Kick the current tech editor to the curb and find someone who knows Chef. And Ruby. Seriously. Other minor, but annoying grammar errors, such as "to" when mean "for" are distracting but tolerable as it would seem one of the authors is perhaps not a native English speaker.
Yes, I do realize that this is a preview release (hence 2 stars instead of 1). Perhaps my criticism is harsh but I'm hoping also constructive. This book has potential if they flesh it out and put some meat on its bones, fix the typos, etc. And I am hoping that they will. In it's current state, however, I could not recommend it.
Well, that's my two cents worth. You get what you pay for. If you're lucky.
Bottom Line No, I would not recommend this to a friend
Merchant response: Thanks for writing a thorough review of this early release. We want to make sure you know that early release ebooks are made available while the author is writing, so you can expect that there will be typos and grammatical errors, as well as possibly some technical errors. The content has not gone through production copyediting/proofreading, so it won't be in the same state that a finished book would be.
You will receive updates as the book progresses, as well as receiving the final, edited, tech reviewed ebook. If you find technical errors or areas that are unclear in the early release, feel free to submit them at http://www.oreilly.com/catalog/errata.csp?isbn=0636920032397 and the author will review your submissions.
Also, I want to make sure you know we have a 100% satisfaction guarantee, and if you're ever dissatisfied with one of our products, you can find refund details at http://oreilly.com/go/guarantee