Provided that the plugin is in Ohai’s load path, it should get loaded
along side all of the built-in plugins. The one exception is the very
first run of chef-client on a node. Since many people depend on a
cookbook to put the custom ohai plugin in place. If you are putting
the ohai plugin in place in a recipe and reloading ohai (even if you
move those resources into the compile phase), then your attribute will
be available in the recipes but not in the attribute files since the
recipes are evaluated after attribute files inside the compile phase.
One option to get around this would be to make sure that required
custom plugins get put on disk during your bootstrap process.
On Fri, Jan 30, 2015 at 9:33 PM, Douglas Garstang
That’s not the behaviour I saw. I was putting a ‘puts’ in the
attributes/default.rb file and doing a chef-client run. Stuff set from core
ohai was showing up. Stuff set from custom ohai plugins was not. The stuff
from custom ohai plugins is available in recipes though.
On Thu, Jan 29, 2015 at 6:19 PM, Ranjib Dey email@example.com wrote:
yes, if its a ohai plugins it will be evaluated in the node build stage,
which happens before cookbook compilation,
On Thu, Jan 29, 2015 at 2:04 PM, Douglas Garstang
Is the data returned from custom ohai plugins going to be available when
evaluating stuff in attributes.rb? I have a plugin which tells me if I am
running inside an EC2 VPC. I’d like to use that in my attributes.rb with
some ‘when’ logic to set some attributes. Yes? No?