On Mon, Feb 4, 2013 at 5:41 PM, David Kerr <ker...@gmail.com> wrote: > My template for this chunk looks like: > <% Array(ipaddress).zip(Array(pgport)).each do |ipaddress,port| -%> > <% backend = 0 %> > backend_hostname<%= backend -%> = <%= ipaddress %> > backend_port<%= backend -%> = <%= port %> > backend_weight<%= backend -%> = 1 > backend_data_directory<%= backend -%> = '/db/pg' > backend_flag<%= backend -%> = 'ALLOW_TO_FAILOVER' > <% backend += 1 %> > <% end %> >
I think your problem is you are re-initializing the 'backend' variable each iteration of the loop. Try: <% backend = 0 -%> <% Array(ipaddress).zip(Array(pgport)).each do |ipaddress,port| -%> backend_hostname<%= backend -%> = <%= ipaddress %> backend_port<%= backend -%> = <%= port %> backend_weight<%= backend -%> = 1 backend_data_directory<%= backend -%> = '/db/pg' backend_flag<%= backend -%> = 'ALLOW_TO_FAILOVER' <% backend += 1 -%> <% end %> Cheers, Aaron Russo IST Infrastructure Services, Unix Group UC Berkeley --- Desk: 510-643-5550Mobile: 510-206-1532 IM: aru...@berkeley.edu (XMPP/Jabber) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.