Book Image

Chef Infrastructure Automation Cookbook Second Edition

By : Matthias Marschall
Book Image

Chef Infrastructure Automation Cookbook Second Edition

By: Matthias Marschall

Overview of this book

Table of Contents (14 chapters)
Chef Infrastructure Automation Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Inspecting the results of your last Chef run


More often than we like to admit, Chef client runs fail. Especially when developing new cookbooks, we need to know what exactly went wrong.

Even though Chef prints all the details to stdout, you might want to look at it again, for example, after clearing your shell window.

Getting ready

You need to have a broken cookbook in your node's run list.

How to do it...

Carry out the following steps:

  1. Run the Chef client with your broken cookbook:

    user@server:~$ sudo chef-client
    ================================================================================
    Recipe Compile Error in /var/chef/cache/cookbooks/my_cookbook/recipes/default.rb
    ================================================================================
    NoMethodError
    -------------
    undefined method `each' for nil:NilClass
    
    Cookbook Trace:
    ---------------
      /var/chef/cache/cookbooks/my_cookbook/recipes/default.rb:7:in `from_file'
    
    Relevant File Content:
    ----------------------
    /var/chef/cache/cookbooks...