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

Chapter 7. Roles and Environments

We now know how to manage a particular component of our infrastructure using a resource, how to group together resources, and how to manage interactions between different resources by getting them grouped together in a recipe. We also know how to group recipes and attributes together in a cookbook.

However, in most practical use cases, you'll find that no single cookbook is useful for the purpose of configuring a system. This problem can be handled in two ways. One way to handle this issue is to get everything required to be configured on a machine inside one cookbook. Now this approach has a very fundamental flaw, as these recipes/cookbooks won't be reusable to a great extent and they'll be very bulky too. As we all know, a good development practice is to break down things into smaller chunks and include whatever is required when required. Roles specifically allow us to do this.

A role in Chef is a way to group together attributes and cookbooks to facilitate...