Am 06.06.2010 01:30, schrieb Markus Roberts:
It seems to me we kind of have two problems: How to uniquely
specify the resource with parameters, and how to specify it with a
resource reference. Your solution (the title becomes a template
filled in by the different parameters) does kind of neatly solve it,
but I'm afraid it might be too complicated for normal humans to use.
Playing around with it at puppet came we came to the conclusion that,
while it could in principle get too complicated to use, in the actual
use cases it was dead obvious what was intended--in part because the
formats we are wanting to model are themselves extremely well known.
What I think you were referring to ("title becomes a template") was only
meant for documentation generation. (Ab-)Using this as a way to create a
canonical title, seems to magical to me.
I failed to include a little bit of code to actually make the title
generation explicit. There should be a separate, explicit code-block in
the newtitle that creates the canonical title from the resource:
newtitle do
# match incoming parameters
pattern "([...@]+)@([...@]+)", :user, :host
pattern "([...@]+)", :user
# produce canonical title form for referencing
canonical_form do
"%...@%s" % [ @resource[:user], @resource[:host] ]
end
end
Especially on the file type, which has very different syntaxes for the
same property combinations (eg: "host:/share" for NFS and "\\host\share"
for UNC) whould need more intelligence than simple substitution for
title generation, while for documentation it would still work.
Does this address your concerns?
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.