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?
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?
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.
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?
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.
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.
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?