[chef] Re: RE: Ohai Plugin Running External Commands


Chronological Thread 
  • From: Douglas Garstang < >
  • To:
  • Subject: [chef] Re: RE: Ohai Plugin Running External Commands
  • Date: Wed, 3 Dec 2014 10:20:04 -0800

Thanks.

I was actually trying to get a list of ec2 instances having tags with specific values. I don't want to use chef search due to the requirement that all the nodes must have successfully completed a chef run first.

Douglas.

On Wed, Dec 3, 2014 at 8:45 AM, Jeremy Mauro < " target="_blank"> > wrote:

Here is one of our ohai :

lspci = Mixlib::ShellOut.new(

    'lspci -m',

<%  if node['platform_family'] == 'windows' -%>

    :cwd => "<%= node[:pciutils][:path] %>",

<% end -%>

  )

  lspci.run_command

  stdout, stderr = [lspci.stdout, lspci.stderr]

 

 

 

 

 

From: Douglas Garstang [mailto: " target="_blank"> ]
Sent: mercredi 3 décembre 2014 17:28
To: " target="_blank">
Subject: [chef] Ohai Plugin Running External Commands

 

Has anyone got any examples of custom ohai plugins calling external shell commands in ruby and returning the result? Having trouble with it. Need to pull some EC2 tags into chef (via AWS CLI) and an ohai plugin seemed like the right idea.

Doug




--



Archive powered by MHonArc 2.6.16.

§