Book Image

Mastering Chef Provisioning

By : Earl Waud
Book Image

Mastering Chef Provisioning

By: Earl Waud

Overview of this book

This book will show you the best practices to describe your entire infrastructure as code. With the help of this book you can expand your knowledge of Chef because and implement robust and scalable automation solutions. You can automate and document every aspect of your network, from the hardware to software, middleware, and all your containers. You will become familiar with the Chef’s Chef Provisioning tool. You will be able to make a perfect model system where everything is represented as code beneath your fingertips. Make the best possible use of your resources, and deliver infrastructure as code, making it as versionable, testable and repeatable as application software
Table of Contents (17 chapters)
Mastering Chef Provisioning
Credits
Foreword
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Analyzing cookbooks with Foodcritic


Let's take a quick look at another static analysis test tool that is included with ChefDK. That tool is named Foodcritic. Like RuboCop, Foodcritic examines the code in your cookbooks for violations to its rules. However, where RuboCop is a generic Ruby linter, Foodcritic is a Chef-specific linting tool. The difference being that using RuboCop helps you to keep your cookbooks in line with Ruby best practices, and Foodcritic helps to keep your cookbooks in line with Chef best practices. Foodcritic currently has 61 built-in rules to evaluate your cookbooks and allows the creation and use of custom rules as well. Both tools have their value, and I suggest that there is a place for each one in your DevOps workflow.

Using Foodcritic

You will find using Foodcritic to be very much like using RuboCop. It is expected that you will be testing individual cookbooks and as such will execute Foodcritic at the command line in the folder of the cookbook being tested, or...