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


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

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.

§