The Chef Survival Guide cover page

The Chef Survival Guide

The Chef Survival Guide

An Opinionated Approach to Test Driven Chef Development

The Chef Survival Guide Edit


About the Book

Note: I'm not really maintaining this book anymore, I think some of the information may still be relevant, but much could be outdated. If you find value, that's great, if not I won't feel bad if you "kindly" return. If you are interested in contributing, contact me and we can work something out. Thanks!

Chef is a great way to manage your infrastructure in an automated way. It's relatively new and has amazing community support. With any new technology there will be lots of competing documentation, best practices, tools and opinions. This book catalogs the process I used to develop the Chef Broiler Plate repository which integrates some of the most popular tools that exist right now to aid in Chef cookbook development.

You will learn, as I did, how to build from the ground up a framework for building cookbooks that adhere to high standards of code quality and test driven development.

This book is under active development, I'm in the process of fleshing out each section and adding more examples.

Topics include:

  • Project Setup
  • Build System
  • Continuous Integration
  • Knife Usage
  • Universal Configuration for Team Development
  • TDD with Chefspec and Minitest
  • Cookbook Code Quality
  • Workflow
  • Dependency Management

Praise for The Chef Survival Guide

I've been struggling with Chef for a few months now and it has repeatedly blown my mind how, for something as popular as it appears to be, there is simply no good reading material for it. This is timely and a really big deal.

Trustfundbaby, Hacker News

Read more

Table of Contents

  • Introduction
    • The Spirit
    • The Menu
  • 1 DevOps: You’re Now a Developer
    • Infrastructure as Code
    • Code Requires Testing
    • Test First
  • 2 Basic Requirements
    • Installing Virtual Box
    • Setting up the Knife CLI Tool
    • Creating a Chef Server Account
    • Installing your Security Keys
    • Where are we?
  • 3 Project Creation
    • Create a new Project
    • Using Git Flow
    • Readme Driven Development
  • 4 Build System with Rake
    • Set Ruby Version
    • Create a Gemfile
    • Install the Dependencies
    • Create Rakefile
  • 5 Continuous Integration with Travis
    • Configuring Travis
    • Update your Gemfile
    • Update your
  • 6 Knife Configuration
    • Creating your Knife Configuration
    • Determining your Variable Dependencies
    • Verify your Keys
    • Setup your Knife Configurations
  • 7 Vagrant Configuration
    • Creating a Vagrant Configuration
    • Set up the Project Location
    • Launching the Virtual Box
  • 8 Outside in TDD with Chefspec
    • Update your Gemfile
    • Automate Chefspec Cookbook Creation
    • Create Your Sample Cookbook (WOO!)
    • Create a Failing Spec
    • Make your Spec Pass
  • 9 Code Quality with Foodcritic
    • Add the Foodcritic Gem
    • Creating a Rake Task
    • Follow the Rules!
  • 10 Cookbook Testing with Knife
    • Prepare a Knife CI Configuration
    • Adding the Rake Task
    • Update the Build Task
    • Update the CI Configuration
  • 11 Workflow Management with Spork
    • Update your Gemfile
    • Configure your Spork
    • Making an Example Change
    • Make the Tests Pass
    • Upload the Updated Cookbook
  • 12 Dependency Management with Berkshelf
    • Update your Gemfile
    • Configure your Cookbook Dependencies
    • Install the Community Cookbooks
    • Update the Vagrant File Run List
  • 13 Infrastructure Verification with MiniTest
    • Put your Files Somewhere!
    • Building the Test
    • Deploying the Cookbook and Testing
  • 14 Conclusion

Read More

About the Author

The Leanpub Unconditional, No Risk, 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks. We process the refunds manually, so they may take a few days to show up.
See full terms