0

The ohai-example helps a lot to package a ohai plugin in a cookbook. In my default recipe I use

 ohai_plugin 'ohai-example'

After a chef.run the custom ohai plugin is placed at

 /home/user/cookbooks/ohai/plugins/ohai-example.rb

I use the following parameters for the chef run:

chef-client --local-mode -c config.rb

My config.rb

chef_zero.enabled true
cookbook_path [
    '/home/user/.chef/cookbooks',    #ohai cookbook
    '/home/user/cookbooks'           #ohai-example cookbook 
]
local_mode true

Is it possible to specify another directory for the ohai plugins?

user5580578
  • 1,134
  • 1
  • 12
  • 28

1 Answers1

0

use ohai_plugin resource and utilize the path attribute

path - The path to your custom plugin directory. Defaults to a directory named 'plugins' under the directory 'ohai' in the Chef config dir.

Mr.
  • 9,429
  • 13
  • 58
  • 82
  • This is the path to your custom plugin directory. I would like to change the directory in which the plugins are copied by the ohai cookbook. – user5580578 Mar 30 '20 at 06:04