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 RuboCop


We begin with a look at tools working within the cookbooks-as-code model. These tools are considered static analysis test tools, and they examine the code itself to verify syntax, structure, and alignment with desired coding practices. The first tool we'll explore is named RuboCop.

Simply put, by using RuboCop, you will produce better cookbooks. RuboCop is included as part of the ChefDK installation. It is a command-line tool used to test the syntax and style of individual cookbooks. RuboCop uses a set of rules, known as cops, to test specific considerations, such as syntax, style, and metrics for Ruby best practices. These cops deliver results as warnings, deviations from convention, and different levels of errors. The main benefits of using RuboCop are that you identify errors early in the development process and the resulting code conforms to an agreed upon style and formatting practice. So, how do we use RuboCop? Let's take a look now.

Using RuboCop

The...