[Puppet Users] create multiple resources from an array of things.

2012-07-08 Thread Wolf Noble
Hi gang, I feel like I'm missing something fundamental here… I've got the following: class snmp::rhel::rh5enable { $collector = ['10.0.0.1', '10.0.0.2'] define add_snmp_hosts_allow ($ip) { exec { hosts_allow_$ip: command = /bin/echo \snmpd : $ip : ALLOW\ /etc/hosts.allow,

Re: [Puppet Users] create multiple resources from an array of things.

2012-07-08 Thread Eric Shamow
Wolf, Are you calling that parameterized class multiple places? This sounds like a situation where what you want may be a defined type but in fact you are using a parameterized class. You can include paramaterized classes multiple times using include but not using parameters. -Eric --

Re: [Puppet Users] create multiple resources from an array of things.

2012-07-08 Thread Wolf Noble
Hi Eric, No, this class is not being called anywhere else. What I think is going on is that I have an array of two strings, but somehow the defined type is getting a concatenated string which contains both values of the array instead of treating each element of the array as an individual.

Re: [Puppet Users] create multiple resources from an array of things.

2012-07-08 Thread Wolf Noble
I figured out what I was doing wrong. I wasn't (maybe I'm still not? :) ) properly taking advantage of the freebie parameter 'title' of defined types. This now seems to behave like I had hoped it would: class snap::rhel::rh5enable { #... $collector = ['10.0.0.1','10.0.0.2'] #… define