[Puppet Users] Best method for using array variables in classes

2010-01-22 Thread James Cammarata
Hi, we're trying to re-use some variables that are currently used for templating a configuration file. We found out these same hosts need to be in our /etc/hosts file as well, so we'd like to use the built-in host type to do this, but since our list of hosts is stored as an array, I'm having

Re: [Puppet Users] Best method for using array variables in classes

2010-01-22 Thread John T. Guthrie
On 01/22/2010 12:35 PM, James Cammarata wrote: But puppet does not seem to like indexing variables inside classes, and I can't find anywhere in the language reference where to do this currently. Also, despite the fact that the split() function is in the function reference, I am getting the

Re: [Puppet Users] Best method for using array variables in classes

2010-01-22 Thread James Cammarata
On Fri, 22 Jan 2010 14:17:26 -0500, John T. Guthrie jguth...@limewire.com wrote: On 01/22/2010 12:35 PM, James Cammarata wrote: But puppet does not seem to like indexing variables inside classes, and I can't find anywhere in the language reference where to do this currently. Also, despite the

Re: [Puppet Users] Best method for using array variables in classes

2010-01-22 Thread John T. Guthrie
On 01/22/2010 02:25 PM, James Cammarata wrote: On Fri, 22 Jan 2010 14:17:26 -0500, John T. Guthrie jguth...@limewire.com wrote: On 01/22/2010 12:35 PM, James Cammarata wrote: But puppet does not seem to like indexing variables inside classes, and I can't find anywhere

Re: [Puppet Users] Best method for using array variables in classes

2010-01-22 Thread James Cammarata
One workaround is to create your own function mysplit() that duplicates the functionality of the 0.25 split() function. I suppose if you wanted to, you could even grab the split.rb file from the latest puppet source code, and use that as a custom function if you are not ready to upgrade

Re: [Puppet Users] Best method for using array variables in classes

2010-01-22 Thread Thomas Bellman
James Cammarata wrote: Hi, we're trying to re-use some variables that are currently used for templating a configuration file. We found out these same hosts need to be in our /etc/hosts file as well, so we'd like to use the built-in host type to do this, but since our list of hosts is stored as