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
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Knife and Its Associated Plugins
10
Data Bags and Templates
Index

Chapter 9. Ohai and Its Plugin Ecosystem

As part of chef-client run, one of the concerns is to collect information about the underlying operating system, hardware, and other environment-related details. The chef-client relies on a utility called Ohai for this purpose.

Ohai is a tool that is used to detect attributes on a node and, once it has profiled the concerned node, it can emit a JSON data blob, containing all the attributes collected by it. Ohai can be used as a stand-alone utility. However, generally, a chef-client uses it to collect node attributes. When Ohai is used in stand-alone mode, it emits the data as JSON; however, when used by the chef-client, it reports back the data through node attributes.

Ohai comes with its own set of plugins that can be used to extend its functionality or scope of its data collection capabilities.

Ohai is a mandatory requirement for a successful chef-client run; hence it must be present on a node. Generally, it is distributed as a Ruby gem during installation...