[chef] Re: Iterating over an array for a set of resources


Chronological Thread 
  • From: Maven User < >
  • To: chef < >
  • Subject: [chef] Re: Iterating over an array for a set of resources
  • Date: Tue, 16 Oct 2012 20:52:50 -0400

A better way would be - how can I user a property in a recipe to expand tokens inside an erb file - or is that not possible?



On Tue, Oct 16, 2012 at 7:46 PM, Maven User < " target="_blank"> > wrote:
Hi list -

I'm struggling a little bit with something - I'm trying to provision a "demo" environment and we need to set up several "fake" users.

Part of this process is to fill in some data in a template then run a script, but I feel like the loop just selects the last thing in the array:

orgs = ["Ermergerd", "FOO"]


orgs.each do |org|
   Chef::Log.info("Org is : " + org)
   node.set[:org] = org
   Chef::Log.info("Org after node set: " + node[:org])
end

Is there a way to do this?  I'm not even seeing anything come out of that loop :-/




Archive powered by MHonArc 2.6.16.

§