Search code examples
chef-infra

Replace ohai-plugin with...?


We've been using the ohai plugin for our windows servers. The plugin detects/collects the info on if there is any windows update available and/or if the server needs a reboot

ohai_plugin 'ohai_windows_updates'
ohai_plugin 'ohai_windows_reboot'

Now I've read that ohai is deprecated. I tried to find out how we can collect such information otherwise but I couldn't find it. Maybe you can help?


Solution

  • As the authers point out in the cookbook readme:

    This cookbook has been deprecated as all functionality here is now built into the Chef Infra Client itself. 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.

    So the ohai_hint resource is now available since Chef Client v14.0.

    And about cookbooks document says that ohai/ folder in cookbook can be used as source of custom Ohai plugins written to load additional information about your nodes to be used in recipes. This requires Chef Infra Server (not Client!) v12.18.14 or later.

    So to continue to use your plugins you need to make sure your Chef Infra Server is at least v12.18.14 and move plugin files into ohai/ folder of some cookbook.

    Or leave everything as is for now. Because deprecation in this case means just stopping of further development - the cookbook will not we deleted. You can continue using it, if for some reason you cannot upgrade your Chef Server.