Book Image

Mastering Chef

By : Mayank Joshi
Book Image

Mastering Chef

By: Mayank Joshi

Overview of this book

Table of Contents (20 chapters)
Mastering Chef
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Knife and Its Associated Plugins
10
Data Bags and Templates
Index

Best practices when writing recipes


As with any coding practice, there are some good practices that, when adopted, lead to better code quality:

  1. Don't repeat yourself. This is especially important because generally system administrators have the habit of working in silos. Every other system administrator feels some sense of pride in having a repository full of tools of trade that he/she has written himself/herself. Now, there is nothing wrong with that; however, almost 95 percent of tools are rewrites. Avoid doing so with your recipes. Reusability is a wonderful concept and rather than wasting time in writing recipes from scratch, make use of recipes that are already available within the community. If you are really feeling the itch, write a wrapper, work with the community to improve features in a cookbook, or extend the available set of cookbooks by writing recipes for things for which there isn't any cookbook currently available.

  2. Don't feel stupid when using the include_recipe method. It...