Book Image

Learning Chef

By : Rishabh Sharma, Mitesh Soni
Book Image

Learning Chef

By: Rishabh Sharma, Mitesh Soni

Overview of this book

<p>Chef automation helps to transform infrastructure into simple code. This means that building, rebuilding, configuration, and scaling to meet your customer's needs is possible in just a few minutes in a real-time environment.</p> <p>This book begins with the conceptual architecture of Chef, walking you through detailed descriptions of every Chef element. You will learn the procedure to set up your workstation and how to create a Cookbook in a hosted Chef environment.</p> <p>Private Chef Server setup is covered in depth, with information on the necessity of on-premise Private Chef deployment, benefits, and installation and configuration procedures for the different types of Private Chef servers including standalone, tiered, and high-availability.</p> <p>This book sheds light on industry best practices with practical Chef scenarios and examples.</p>
Table of Contents (17 chapters)
Learning Chef
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Introducing data bags


A data bag is JSON's data format global variable that is used as an index for search queries and is accessible from the Chef server. Data bag is loaded through recipes and most of the time, it contains secured information, such as passwords.

Data bag is very good for securing secret information because data bag can be encrypted easily.

The knife data bag subcommand is used to create, delete, edit, list, and show data bags.

The create argument creates a data bag on the Chef server:

knife data bag create <<DATA_BAG_NAME>> [DATA_BAG_ITEM] (options)

The following is a screenshot of the verification of a data bag creation on the Hosted Chef server:

We can also create a data bag from the dashboard of the hosted Chef server. Go to Policy, click on Data Bags, and select Create Item.

We can also create an item associated with a data bag from the dashboard of the hosted Chef server.

The create argument deletes a data bag from the Chef server:

knife data bag delete <...