[chef] Re: Re: Set node value from script output


Chronological Thread 
  • From: John Alberts < >
  • To:
  • Subject: [chef] Re: Re: Set node value from script output
  • Date: Mon, 27 Jun 2011 17:25:52 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=h2P59mGxF9AwTNoHQtoFjDVqzC50oB4hlv/4PkzcglLFYcFpopEki4zEeRkgFI2Mk+ oUX/BHxaJswTiGCNdmy/L1Pc5tUoFQcdHIjtUrhZOAUwZxfEJUgGgrVpM2aILGtySIb7 liERLFx5hsWWkoB3V7Imy5dGe4TwKByRb0du0=

Something like the following should work as well.

node[:myattribute] = %x[/usr/bin/myscript]

John


On Mon, Jun 27, 2011 at 3:55 PM, Noah Kantrowitz < "> > wrote:

On Jun 27, 2011, at 1:46 PM, Matthew Drobnak wrote:

> I need the output of a script to set a node value, from inside a cookbook. How would one do this?

You will have to call Chef::ShellOut (or something similar) from within a ruby_block resource.

--Noah



--
John Alberts




Archive powered by MHonArc 2.6.16.

§