On 6/9/2010 3:08 PM, Luke Kanies wrote:
On Jun 9, 2010, at 3:27 AM, David Schmitt wrote:
On 6/8/2010 7:18 PM, Markus Roberts wrote:
David --
> I'll leave the final decision to you. Just let me restate that I
believe that having the additional
> "render" or "to_s" block (what I called "canonical_form" in
<[email protected] <mailto:[email protected]>>)
> for display purposes[1] wouldn't hurt as much as not being able to
use defaults for properties.
So after hashing it out in various groups the overwhelming consensus is
to do the parsing part now and leave the generation part for later if
the need materializes.
In the course of the discussions I realized that I don't understand your
"not being able to use defaults for properties" comment. Could you
elaborate?
Sure. I was referring to this snippet in my original spec:
Mysql_user { host => "webserver" }
mysql_user { [ "frob", "frub" ]: }
# expands to 'f...@webserver' and 'f...@webserver'
mysql_user {
"frob": host => "web1";
"frob": host => "web2";
"frob": host => "web3";
}
The last stanza shows how this can be used to confusing effects.
Specifically, I am worried that Mysql_user[frob] becomes illegal
and/or confusing. Thinking more about it, I come to the realisation
that mysql_user[f...@web1] can use the patterns on the type to create
a valid reference to a single resource.
I think in this case we need a clear definition of how this should
behave, but the specific definition doesn't actually matter that much.
I'd tend toward Mysql_user[frob] in this case essentially translating to
the three resources; that is, requiring that reference is functionally
equivalent to requiring all three of the actual user instances.
I'd be just as happy for this to fail if it referred to more than one
resource. That is, if you wanted to depend on Mysql_user[frob], you'd
have to change your code to this:
mysql_user {
frob_web1: name => frob, host => web1;
frob_web2: name => frob, host => web2;
...
}
Then the reference would have to be Mysql_user[frob_web1].
This is obviously the easiest short-term solution and is probably what I
would go with to start.
+1.
Later this can integrate the collection query syntax to reference more
resources like Mysql_user[|user == 'frob'|] or something.
Best Regards, David
--
dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at
Klosterneuburg UID: ATU64260999
FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg
--
You received this message because you are subscribed to the Google Groups "Puppet
Developers" 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-dev?hl=en.