Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

The ohai cookbook has been deprecated

Author provided reason for deprecation:

The ohai cookbook has been deprecated and is no longer being maintained by its authors. Use of the ohai cookbook is no longer recommended.


ohai (40) Versions 2.1.0

Provides custom resources for installing Ohai hints and plugins

cookbook 'ohai', '= 2.1.0', :supermarket
cookbook 'ohai', '= 2.1.0'
knife supermarket install ohai
knife supermarket download ohai
Quality 100%

ohai Cookbook

Build Status Cookbook Version

Creates a configured plugin path for distributing custom Ohai plugins, and reloads them via Ohai within the context of a Chef Client run during the compile phase (if needed).



  • Debian/Ubuntu
  • RHEL/CentOS/Scientific/Amazon/Oracle
  • FreeBSD
  • Windows


  • Chef 11+


  • none


  • node['ohai']['plugin_path'] - location to drop off plugins directory, default is /etc/chef/ohai_plugins. This is not FHS-compliant, an FHS location would be something like /var/lib/ohai/plugins, or /var/lib/chef/ohai_plugins or similar.

    Neither an FHS location or the default value of this attribute are in the default Ohai plugin path. Set the Ohai plugin path with the config setting "Ohai::Config[:plugin_path]" in the Chef config file (the chef-client::config recipe does this automatically for you!). The attribute is not set to the default plugin path that Ohai ships with because we don't want to risk destroying existing essential plugins for Ohai.

  • node['ohai']['plugins'] - sources of plugins, defaults to the files/default/plugins directory of this cookbook. You can add additional cookbooks by adding the name of the cookbook as a key and the path of the files directory as the value. You have to make sure that you don't have any file conflicts between multiple cookbooks. The last one to write wins.

  • node['ohai']['hints_path'] - location to drop off hints directory, default is /etc/chef/ohai/hints.


Put the recipe ohai at the start of the node's run list to make sure that custom plugins are loaded early on in the Chef run and data is available for later recipes.

The execution of the custom plugins occurs within the recipe during the compile phase, so you can write new plugins and use the data they return in your Chef recipes.

For information on how to write custom plugins for Ohai, please see the Chef wiki pages.

PLEASE NOTE - This recipe reloads the Ohai plugins a 2nd time during the Chef run if:
- The "Ohai::Config[:plugin_path]" config setting has NOT been properly set in the Chef config file
- The "Ohai::Config[:plugin_path]" config setting has been properly set in the Chef config file and there are updated plugins dropped off at "node['ohai']['plugin_path']".



Create hints file. You can find usage examples at test/cookbooks/ohai_test/recipes/*.rb.

Resource Attributes

  • hint_name - The name of hints file and key. Should be string, default is name of resource.
  • content - Values of hints. It will be used as automatic attributes. Should be Hash, default is empty Hash class.

ChefSpec Matchers

You can check for the creation or deletion of ohai hints with chefspec using these custom matches:
- create_ohai_hint
- delete_ohai_hint


For an example implementation, inspect the ohai_plugin.rb recipe in the nginx community cookbook.

License & Authors

Author: Cookbook Engineering Team (

Copyright: 2011-2016, Chef Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

acpi Applicable Versions
afw Applicable Versions
alphard-aws Applicable Versions
amoeba_basenode Applicable Versions
aws Applicable Versions
aws-codedeploy-agent Applicable Versions
azure Applicable Versions
azure_fqdn_fix Applicable Versions
bash-shellshock Applicable Versions
berkshelf-api-server-ya Applicable Versions
certbot-exec Applicable Versions
chef-attributes Applicable Versions
chef_bird Applicable Versions
chef_cfn Applicable Versions
chef_nginx Applicable Versions
chef_systemd Applicable Versions
chocolatey-ohai-plugin Applicable Versions
cloudformation Applicable Versions
common_linux Applicable Versions
crowd Applicable Versions
diskanalyser Applicable Versions
dotnet-core Applicable Versions
dovecot Applicable Versions
ec2-tags-ohai-plugin Applicable Versions
emacs24 Applicable Versions
eos Applicable Versions
gnugpg Applicable Versions
gozer Applicable Versions
ibm-power Applicable Versions
kali Applicable Versions
lemur Applicable Versions
microfocus-server Applicable Versions
minecraft Applicable Versions
mysql_tuning Applicable Versions
nginx Applicable Versions
ngx Applicable Versions
nodeinfo Applicable Versions
ohai-private-ipaddress Applicable Versions
ohai-scaleway Applicable Versions
ohai_public_info Applicable Versions
onddo_proftpd Applicable Versions
openresty Applicable Versions
opsworks_ruby Applicable Versions
os_floating_lo Applicable Versions
ovh-api Applicable Versions
paramount Applicable Versions
pkg-build Applicable Versions
platformstack Applicable Versions
qas Applicable Versions
rackops_rolebook Applicable Versions
rackspace_cloudbackup Applicable Versions
rackspace_networks Applicable Versions
rackspace_support Applicable Versions
rbenv Applicable Versions
salt Applicable Versions
sas2ircu Applicable Versions
spacewalk-server Applicable Versions
stack-base Applicable Versions
stegosoc-windows Applicable Versions
storage Applicable Versions
sysctl Applicable Versions
webinar1-myapp Applicable Versions
windows Applicable Versions
zerotier Applicable Versions

ohai Cookbook CHANGELOG

This file is used to list changes made in each version of the ohai cookbook.

v2.1.0 (2016-01-26)

  • Properly handle creating ohai hints without specifying the content. Previously if the content wasn't specified a deprecation notice would be thrown and the file would not be created
  • Simplified the test suite and added inspec tests to ensure hints are created, especially if the content is not specified
  • Added FreeBSD and Windows as supported platform in the metadata and add them to the Test Kitchen config
  • Add Test Kitchen integration tests to Travis CI
  • Updated testing Gems to the latest releases in the Gemfile

v2.0.4 (2015-10-30)

  • Resolved deprecation warnings with the Chefspec matchers

v2.0.3 (2015-10-21)

  • Validate the hints before loading them to avoid failures
  • Added supported platforms to the metadata
  • Updated .gitignore file
  • Updated Test Kitchen config for the latest platforms
  • Added Chef standard Rubocop config
  • Added Travis CI testing
  • Added Berksfile
  • Updated contributing and testing docs
  • Added and maintainers.toml files
  • Added Travis and cookbook version badges to the readme
  • Expanded the requirements section in the readme and clarify the minimum supported Chef release is 11
  • Updated Opscode -> Chef Software
  • Added a Rakefile for simplified testing
  • Added a Chefignore file
  • Resolved Rubocop warnings
  • Added source_url and issues_url to the metadata
  • Added Chefspec matchers
  • Added basic convergence Chefspec test

v2.0.1 (2014-06-07)

  • [COOK-4683] Remove warnings about reopening resource

Please note, this changes the name of a remote_directory resource. It is not expected that anyone would be explicitly notifying this resource but, please review PR #16 for more info.

v2.0.0 (2014-02-25)

'[COOK-3865] - create lwrp ohai_hint'


  • Dummy release due to a Community Site upload failure



  • COOK-3091 - Fix checking Chef::Config[:config_file]


  • [COOK-1918] - Ohai cookbook to distribute plugins fails on windows
  • [COOK-2096] - Ohai cookbook sets unix-only default path attribute


  • [COOK-2057] - distribution from another cookbok fails if ohai attributes are loaded after the other cookbook


  • [COOK-1128] - readme update, Replace reference to deprecated chef cookbook with one to chef-client


  • [COOK-1424] - prevent plugin_path growth to infinity


  • [COOK-1174] - custom_plugins is only conditionally available
  • [COOK-1383] - allow plugins from other cookbooks


  • [COOK-463] ohai cookbook default recipe should only reload plugins if there were updates

Foodcritic Metric

2.1.0 passed this metric