O'Reilly logo

Chef Infrastructure Automation Cookbook by Matthias Marschall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Flagging problems in your Chef cookbooks

Writing solid Chef recipes can be quite challenging. There are a couple of pitfalls, which you can easily overlook. And writing cookbooks in a consistent style is even harder. You might wonder what the proven ways to write cookbooks are. Foodcritic tries to identify possible issues with the logic and style of your cookbooks.

In this section we'll learn how to use Foodcritic on some existing cookbooks.

Getting ready

  1. Add the foodcritic gem to your Gemfile:
    mma@laptop:~/chef-repo $ subl Gemfile
    
    source 'https://rubygems.org'
    gem 'foodcritic', '~>2.2.0'
  2. Run Bundler to install the foodcritic gem:
    mma@laptop:~/chef-repo $ bundle install
    
    Fetching gem metadata from https://rubygems.org/ ...TRUNCATED OUTPUT... Installing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required