Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-09 Thread Sirtaj Singh Kang
(apologies for the derail) On 09-Jun-11, at 7:51 PM, jcbollinger wrote: [snip] On Jun 9, 1:33 am, Sirtaj Singh Kang wrote: On 08-Jun-11, at 9:31 PM, Brian Gallew wrote: [snip] See, there's the crux of the issue: arrays are *not* a method of looping. Puppet's DSL is declarative, not procedur

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-09 Thread Aaron Grewell
Part of the challenge is that I haven't seen a generally accepted language that succinctly describes what arrays do. If I had it to say again I would have said arrays are Puppet's only available declarative multiplier. On Thu, Jun 9, 2011 at 7:21 AM, jcbollinger wrote: > > > On Jun 9, 1:33 am, S

[Puppet Users] Re: Virtual resources and hashes

2011-06-09 Thread jcbollinger
On Jun 9, 1:33 am, Sirtaj Singh Kang wrote: > On 08-Jun-11, at 9:31 PM, Brian Gallew wrote: > [snip] > > > > > See, there's the crux of the issue: arrays are *not* a method of   > > looping.  Puppet's DSL is declarative, not procedural (imperative). > > This isn't precisely true - every pure fun

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Sirtaj Singh Kang
On 08-Jun-11, at 9:31 PM, Brian Gallew wrote: [snip] See, there's the crux of the issue: arrays are *not* a method of looping. Puppet's DSL is declarative, not procedural (imperative). This isn't precisely true - every pure functional language I've seen has some sort of list map and filt

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Aaron Grewell
Nice! More good things to look forward to. :) On Wed, Jun 8, 2011 at 1:58 PM, Nigel Kersten wrote: > > > On Wed, Jun 8, 2011 at 1:36 PM, Aaron Grewell wrote: > >> We've looked at two different possibilities thus far: >> >> 1) Make all resource types hash-aware. This is what I was originally >

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Nigel Kersten
On Wed, Jun 8, 2011 at 1:36 PM, Aaron Grewell wrote: > We've looked at two different possibilities thus far: > > 1) Make all resource types hash-aware. This is what I was originally > asking for. It would mean changing the way resources are declared so that > in the case of a hash their represen

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Aaron Grewell
We've looked at two different possibilities thus far: 1) Make all resource types hash-aware. This is what I was originally asking for. It would mean changing the way resources are declared so that in the case of a hash their representation of $name was appropriate for use with defines and virtua

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Randall Hansen
On Wed, Jun 8, 2011 at 12:07 PM, Aaron Grewell wrote: > All I'm saying is that I think hashes should be first-class citizens in > Puppet and right now they're not. I agree with that as a high-level problem statement, but to make progress we need to put legs on it. John's got one possibility: a

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Aaron Grewell
All I'm saying is that I think hashes should be first-class citizens in Puppet and right now they're not. Every other object can be placed in an array and easily and scalably declared. Hashes are "special" because you can declare them like anything else, but you can't use them like anything else.

[Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread jcbollinger
On Jun 8, 12:17 pm, Randall Hansen wrote: > On Tue, Jun 7, 2011 at 4:15 PM, Aaron Grewell wrote: > > $users = [{ username => "bill", uid => "12345" }, > > { username => "ted",  uid => "12346" }] > > Aaron, I think this is a completely sane request.  We've talked about > it before, but

[Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread jcbollinger
On Jun 8, 11:33 am, Aaron Grewell wrote: > If you look at what I tried to do you'll realize that's not the case.  I > understand what you're saying, but the issue is one of Puppet not supporting > its own 'syntactic sugar' consistently.  I created an array (this is not a > convenience for a larg

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Aaron Grewell
I suspect the root of the problem I'm running into may be the simple nature of $name. It's not capable of being an arbitrary object. I consider that an architectural issue in a system that supports hashes which are structured objects that can't really be reduced to a string. IMHO for a future ve

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Aaron Grewell
If you look at what I tried to do you'll realize that's not the case. I understand what you're saying, but the issue is one of Puppet not supporting its own 'syntactic sugar' consistently. I created an array (this is not a convenience for a large number of machines, it's a requirement) but since

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Aaron Grewell
Here's the thing though: since arrays are the only native method of looping, Puppet needs to handle arrays of all native types well. If it doesn't, from an end-user perspective that's broken. On Wed, Jun 8, 2011 at 8:36 AM, jcbollinger wrote: > > > On Jun 7, 6:15 pm, Aaron Grewell wrote: > > Hm

Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread Brian Gallew
On Jun 8, 2011, at 8:45 AM, Aaron Grewell wrote: > Here's the thing though: since arrays are the only native method of looping, > Puppet needs to handle arrays of all native types well. If it doesn't, from > an end-user perspective that's broken. See, there's the crux of the issue: arrays are

[Puppet Users] Re: Virtual resources and hashes

2011-06-08 Thread jcbollinger
On Jun 7, 6:15 pm, Aaron Grewell wrote: > Hmmm, either I'm doing something wrong or virtual resources are incompatible > with hashes. I think it's a mix of about two parts "doing something wrong" to one part "incompatible", coming out to more or less "Puppet doesn't do what I wish it would."