Skip to main content

Creating an Ohai Plugin

Hands-On Lab


Photo of

Training Architect





By default, Ohai provides a lot of information about the systems that are managed by Chef. But that doesn't mean that it provides everything we might like to know. Occasionally, we would like to be able to calculate additional information at chef-client runtime. We could use that information in recipes, or simply store it for querying later.

In this learning activity, you'll be asked to create an Ohai plugin. It will add information to the node object about the names of groups that exist on the system. You can query the Chef Server for this information later on. By the time you're finished with this activity, you should feel more comfortable using the Ohai DSL, and adding additional information to the node object using a custom Ohai plugin.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.