What is Ohai in Chef?

What is Ohai in Chef?

Ohai is a tool that is used to collect system configuration data, which is provided to the chef-client for use within cookbooks. Ohai is run by the chef-client at the beginning of every Chef run to determine system state.

What is OHAI plugin?

An Ohai plugin is a Ruby DSL. There are several community OHAI cloud plugins providing cloud specific information. Writing OHAI plug-in for the Azure IaaS cloud: In simple words Ohai plug-in is a ruby DSL that populates and returns a Mash object to upload nested data.

What are phases of Chef execution?

There are two phases to a Chef client run. the ruby is loaded, node attributes are resolved and a run list generated. – Next is the execution phase, where the recipes in the run list are executed. How to Force the order of recipes with Chef?

Which resource from Ohai cookbook will help you deploy OHAI plugin?

The ohai_hint resource now ships in Chef Infra Client and any plugins can be installed by placing them in an ohai directory within a cookbook in your runlist.

What is a Berksfile?

Berksfile is the most crucial component of Berkshelf! It’s just like metadata for Chef. However, the usage is somewhat different. Berksfile makes it simple to download a dependency cookbook from chef supermarket (or other places) and upload to the cookbook repository on the server.

How do I run chef-client?

Linux

  1. Log in as root and then run the chef-client.
  2. Use su to become the root user, and then run the chef-client. For example:
  3. Use the sudo utility. $ sudo chef-client.
  4. Give a user access to read /etc/chef and also the files accessed by the chef-client.

What is Chef repo?

Chef repository is where cookbooks, data bags and all other info concerning chef is stored.

What is chef Clientrun?

A chef-client is an agent that runs locally on every node that is under management by Chef. When a chef-client is run, it will perform all of the steps that are required to bring the node into the expected state, including: Registering and authenticating the node with the Chef server.

What is Ohai in chef?

Ohai is a tool that is used to collect system configuration data, which is provided to Chef Infra Client for use within cookbooks. Ohai is run by Chef Infra Client at the beginning of every Chef Infra run to determine system state.

How do I use Ohai with chef infra server?

Run the ohai command on a system to see which automatic attributes Ohai has collected for a particular node. When attribute blocklist settings are used, any attribute defined in a blocklist will not be saved to the Chef Infra Server and any attribute that is not defined in a blocklist will be saved.

How do I block Ohai’s system information gathering?

The recommended practice is to use blocked_automatic_attributes to block attributes populated by Ohai’s system information gathering. Ohai gathers a large number of attributes that can consume a signicant amount of storage space on the Chef Infra Server.

What are Ohai hints?

Ohai hints are used to tell Ohai something about the system that it is running on that it would not be able to discover itself. An Ohai hint exists if a JSON file exists in the hint directory with the same name as the hint. For example, calling hint? (‘antarctica’) in an Ohai plugin would return an empty hash if the file antarctica.