On Jun 8, 12:17 pm, Randall Hansen <[email protected]> wrote:
> On Tue, Jun 7, 2011 at 4:15 PM, Aaron Grewell <[email protected]> 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 I can't find an existing ticket. This one seems close,
> but very old; will you take a look?http://projects.puppetlabs.com/issues/1858
>
> If we can work out a good syntax we'll put this on the roadmap. I
> know some of our PS guys are eager for it, too.
I agree that the concept is reasonable, but I suggest that you
consider implementing it as a new built-in function. Puppet's current
DSL syntax is arcane enough already -- consider all the feedback from
PC EU to that effect. A function for this purpose might be something
like this:
declare($type, $properties, $title_key="title")
$type: the name of the resource type
$properties: a hash or array of hashes of properties for the resources
to declare
$title_key: the key, which must be present in each hash, from which
the title of the corresponding resource instance is obtained
Probably you also need a parameter to select concrete vs. virtual vs.
exported declaration, or else different flavors of the function to
support those alternatives.
Example:
$users = [ { username => "bill", uid => 501 }, { username => "ted",
uid => 502 } ]
declare("User", $users, "username")
Be excellent to each other,
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.