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

Using Chef roles


Roles provide a way of looking at our infrastructure code as a representation of the functions performed by the servers we associate with them. Said another way, a "web server" role is created and assigned to a server that performs the function of a web server.

The benefit here is functional consistency. Whether your goal is to be able to reproduce a server in the event of failure or upgrade, or to deploy multiple identical servers to load balance a function, using a role will allow you to achieve that functional consistency.

A role's definition can be anywhere between very general, such as "Base" role, to very specific, such as "App-A Inventory Backup PostgreSQL DB Server". It is a common practice to use a role to group functionality that goes together, like all the recipes that should be run on every node grouped in a "Base" role.

Sometimes, servers will be assigned a single role, such as "UI Server". Other times, a server will be assigned more than one role. For example...