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

Introduction

In this chapter, we'll see some of the more advanced topics in action. You'll see how to make your recipes more flexible by using search and data bags, and ...

Get Chef: Powerful Infrastructure Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.