Name: ohai
Owner: LinuxONE and Linux on z Systems Open-source Team
Description: Development repository for Chef Cookbook ohai
Created: 2016-04-12 16:57:25.0
Updated: 2016-04-12 16:57:26.0
Pushed: 2016-04-13 04:43:49.0
Homepage: https://supermarket.chef.io/cookbooks/ohai
Size: 91
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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).
node['ohai']['plugin_path']
- location to drop off plugins directory, default is /etc/chef/ohai_plugins
. Note: This is not Filesystem Hierarchy Standard(FHS)-compliant path, a FHS compliant path 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.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. This defaults to the path defined by Ohai, which is /etc/chef/ohai/hints
on Linux and C:/chef/ohai/hints
on Windows.
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 Docs page
https://docs.chef.io/ohai_custom.html
PLEASE NOTE - This recipe reloads the Ohai plugins a 2nd time during the Chef run if:
ohai.plugin_path
” config setting has NOT been properly set in the Chef config fileohai.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']
“.ohai_hint
Create hints file. You can find usage examples at test/cookbooks/ohai_test/recipes/*.rb
.
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.You can check for the creation or deletion of ohai hints with chefspec using these custom matches:
For an example implementation, inspect the ohai_plugin.rb recipe in the nginx community cookbook.
Author: Cookbook Engineering Team (cookbooks@chef.io)
Copyright: 2011-2016, Chef Software, Inc.
nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.