Book Image

Mastering Chef

By : Mayank Joshi
Book Image

Mastering Chef

By: Mayank Joshi

Overview of this book

Table of Contents (20 chapters)
Mastering Chef
About the Author
About the Reviewers
Knife and Its Associated Plugins
Data Bags and Templates

Attribute whitelisting

So, you've got this whole bunch of attributes that have been collected from all different sources and now a final list of attributes has been prepared by the chef-client after applying the precedence order. However, you might not want each and every attribute to persist on the Chef server and this is where we can make good use of whitelisting capabilities. We can specify a whitelist of a set of attributes that we want to be saved by a node. This whitelist can be specified in client.rb. A whitelist is a hash that specifies attributes that need to be saved.

Each attribute type has to be whitelisted separately. Each attribute type—automatic, default, normal, and override—may define whitelists by using the following settings in the client.rb file:




This can be used to specify a hash that whitelists the automatic attributes and prevents non-whitelisted attributes from being saved. If a hash is empty, no attribute is saved...