O'Reilly logo

Infrastructure as Code (IAC) Cookbook by Pierre Pomes, Stephane Jourdan

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

Linting Chef code with Foodcritic and Puppet code with puppet-lint

Since we're mainly coding in Ruby, we can use common linters such as Rubocop in the Ruby world. However, Rubocop, is targeted at software development by default and is not really optimized for Chef cookbooks development. So, Chef adapted their own version of Rubocop, named Cookstyle. In the meantime, the Foodcritic tool used in conjunction with rules checks our code for a set of commonly accepted good practices by the community. We'll walk through those tools to end up with a much better and cleaner code.

Getting ready

To step through this recipe, you will need the following:

  • A working Chef DK installation on the workstation
  • A working Chef client configuration on the remote host
  • The ...

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