New Supermarket Announcements!

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 supermarket mailing list.

Select Badges

Select Supported Platforms

RSS

ohai (21) Versions 4.1.0

Provides custom resources for installing Ohai hints and plugins

Berkshelf
Librarian
Knife
cookbook 'ohai', '~> 4.1.0'
cookbook 'ohai', '~> 4.1.0'
knife cookbook site install ohai
knife cookbook site download ohai
README
Dependencies
Changelog
Foodcritic

ohai Cookbook

Build Status Cookbook Version

Contains custom resources for adding Ohai hints and installing custom Ohai plugins. Handles path creation as well as the reloading of Ohai so that new data will be available during the same run.

Requirements

Platforms

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

Chef

  • Chef 12+

Cookbooks

  • compat_resource

Custom Resources (Providers)

ohai_hint

Creates Ohai hint files, which are consumed by Ohai plugins in order to determine if they should run or not.

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
  • compile_time - Should the resource run at compile time. This defaults to true

Examples

Hint file installed to the default directory:

ohai_hint 'ec2'

Hint file not installed at compile time:

ohai_hint 'ec2' do
  compile_time false
end

Hint file installed with content:

ohai_hint 'raid_present' do
  content Hash[:a, 'test_content']
end

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

ohai_plugin

Installs custom Ohai plugins.

Resource Attributes

  • plugin_name - The name to give the plugin on the filesystem. Should be string, default is name of resource.
  • path - The path to your custom plugin directory. Defaults to a directory named 'ohai_plugins' in the Chef config dir.
  • source_file - The source file for the plugin in your cookbook if not NAME.rb.
  • resource - The resource type for the plugin file. Either :cookbook_file or :template. Defaults to :cookbook_file.
  • variables - Usable only if resource is :template. Defines the template's variables.
  • compile_time - Should the resource run at compile time. This defaults to true.

examples

Simple Ohai plugin installation:

ohai_plugin 'my_custom_plugin'

Installation where the resource doesn't match the filename and you install to a custom plugins dir:

ohai_plugin 'My Ohai Plugin' do
  name 'my_custom_plugin'
  path '/my/custom/path/'
end

Installation using a template:

ohai_plugin 'My Templated Plugin' do
  name 'templated_plugin'
  resource :template
  variables node_type: :web_server
end

ChefSpec Matchers

You can check for the creation or deletion of ohai plugins with chefspec using these custom matches:

  • create_ohai_plugin
  • delete_ohai_plugin

License & Authors

Author: Cookbook Engineering Team (cookbooks@chef.io)

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

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

compat_resource >= 12.9.0

Contingent cookbooks

afw Applicable Versions
alphard-aws Applicable Versions
amoeba_basenode Applicable Versions
aws Applicable Versions
aws-codedeploy-agent Applicable Versions
azure Applicable Versions
bash-shellshock Applicable Versions
chef_cfn Applicable Versions
cloudformation Applicable Versions
common_linux Applicable Versions
dovecot Applicable Versions
emacs24 Applicable Versions
gozer Applicable Versions
kali Applicable Versions
microfocus-server Applicable Versions
minecraft Applicable Versions
mysql_tuning Applicable Versions
nginx Applicable Versions
ohai-private-ipaddress Applicable Versions
ohai_public_info Applicable Versions
onddo_proftpd Applicable Versions
openresty 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
spacewalk-server Applicable Versions
stack-base Applicable Versions
storage Applicable Versions
sysctl Applicable Versions

ohai Cookbook CHANGELOG

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

v4.1.0 (2016-05-26)

  • Added the ability to use templates and pass in variables with the plugin custom resource

v4.0.2 (2016-05-23)

  • Resolve failures on Windows nodes

v4.0.1 (2016-05-19)

  • Added .rb to the name of the plugins so they actually load
  • Added testing to ensure the plugins are being loaded in the chef run

v4.0.0 (2016-05-18)

BREAKING CHANGE:

The 4.0 release of the Ohai cookbook removes the previous cookbook_file behavior that required forking the cookbook and adding your own plugins. Instead the cookbook ships with a new ohai_plugin custom resource for installing plugins. In addition to this new custom resource the cookbook now requires Chef 12+. See the readme and test recipe for examples. If you require Chef 11 support you'll need to pin to version 3.0 in your environment.

v3.0.1 (2016-03-14)

  • Fixed the Chefspec matchers

v3.0.0 (2016-03-14)

  • Change the default value for node['ohai']['hints_path'] to use the Ohai config value. This should be the same value in most use cases, but if a custom path is specified in the chef client config this value will get used automatically by the cookbook.
  • Removed backwards compatibility with Chefspec < 4.1 in the matchers library
  • Fix bad link to the custom Ohai plugin documentation in the readme
  • Improve documentation for node['ohai']['plugin_path']

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 maintainers.md 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'

v1.1.12

  • Dummy release due to a Community Site upload failure

v1.1.10

Bug

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

v1.1.8

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

v1.1.6

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

v1.1.4

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

v1.1.2

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

v1.1.0

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

v1.0.2

  • [COOK-463] ohai cookbook default recipe should only reload plugins if there were updates
FC009: Resource attribute not recognised: /tmp/cook/1c50825ac1f45e3112c41468/ohai/resources/hint.rb:39
FC009: Resource attribute not recognised: /tmp/cook/1c50825ac1f45e3112c41468/ohai/resources/plugin.rb:107
FC016: LWRP does not declare a default action: /tmp/cook/1c50825ac1f45e3112c41468/ohai/resources/hint.rb:1
FC016: LWRP does not declare a default action: /tmp/cook/1c50825ac1f45e3112c41468/ohai/resources/plugin.rb:1