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

Learning the attribute precedence hierarchy


With roles, environments, cookbooks, recipes, and so on, there are many places that attributes can be defined. In addition, there are many types of attributes that can be used. If, as a slight exaggeration, the same attribute is defined in all possible resources, each with a different value, how do you know which value would be applied when chef-client converges the node? Consider a more real-world example if you use an application cookbook that has a default attribute defined for the install directory, and you need that app to install into a different directory, what type of attribute can you use, and where should you set it so that your value would be used instead of the default? The answer to these questions is found in the precedence hierarchy. The factors that determine precedence include the type of attribute, the source of the attribute, and of course, the order evaluated. Let's take a closer look at these factors now.

Understanding attribute...