Book Image

Chef Infrastructure Automation Cookbook

By : Matthias Marschall
Book Image

Chef Infrastructure Automation Cookbook

By: Matthias Marschall

Overview of this book

Table of Contents (14 chapters)
Chef Infrastructure Automation Cookbook Second Edition
About the Author
About the Reviewers

Chapter 4. Writing Better Cookbooks

"When you know better, you do better"

Maya Angelou

In this chapter, we will cover the following recipes:

  • Setting the environment variables

  • Passing arguments to shell commands

  • Overriding attributes

  • Using search to find nodes

  • Using data bags

  • Using search to find data bag items

  • Using encrypted data bag items

  • Accessing data bag values from external scripts

  • Getting information about the environment

  • Writing cross-platform cookbooks

  • Finding the complete list of operating systems you can use in cookbooks

  • Making recipes idempotent by using conditional execution