I am really struggling to get a custom Ohai plugin to work in Windows.
Here is my custom plugin:
Ohai.plugin(:Chris) do provides "chris" collect_data do chris = Mash.new unless chris chris = "why doesn't this work!" Ohai::Log.debug(chris) end end
Here is the recipe I’m using to deploy it:
include_recipe "chef-client::config" ohai_plugin 'chris' do path 'C:\chef\ohai\plugins' action :create end
I can see that it gets deployed to c:\chef\ohai\plugins.
If I go to the PC and run ohai directly, I can see the following output:
PS C:\chef> ohai -l debug
[removed irrelevant log lines]
[2018-03-22T13:32:43+00:00] DEBUG: why doesn’t this work!
[2018-03-22T13:32:43+00:00] DEBUG: Plugin Chris took 0.0 seconds to run.
The Ohai output has no ‘chris’ attributes. I’m at my wits end. Any advice or thoughts?