[chef] Re: knife/ohai


Chronological Thread 
  • From: Ranjib Dey < >
  • To:
  • Cc: " " < >
  • Subject: [chef] Re: knife/ohai
  • Date: Thu, 3 Apr 2014 12:31:47 -0700

you mean the remote node data stored in chef server ? or the local machine's data?

ohai can be invoked directly as:
o = Ohai::System.new ; o.all_plugins ; o[:attr] . 

but this will slow down knife loading ,
for the nodes in chef server, it may be wiser to do that logic on a plugin.
Chef::Node.load('foo')[:attr1] , 
as this requires rest/http stuff , which in turn requires chef to to be configured (i.e. knife.rb)... you may be able to do this with sufficient hacks.. but it might be worth discussing what exactly you are trying to do instead, and check if theres a cleaner way to do so 

best
ranjib


On Thu, Apr 3, 2014 at 12:11 PM, Julio Lajara < " target="_blank"> > wrote:
Is it possible to use data from Ohai in a knife.rb file? Ive been looking for a way to use platform_family? but not sure if this can be called directly or is in some hash if its even available.

Thanks,




Archive powered by MHonArc 2.6.16.

§