O'Reilly logo

Learning Chef by Rishabh Sharma, Mitesh Soni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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)
Introducing data bags

The following is a screenshot of the verification of a data bag creation on the Hosted ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required