(This is probably too radical but bear with me.)

The proposals floating around involving some functions, some +
operators, and some parameters that accept strings or arrays seem to
create lots of leaky abstractions.

For example, if the + operator does anything but concatenate strings
or add numbers, I as a user would be surprised and confused.
Dereferencing its argument pathnames into content seems far outside
its scope.  (Patrick's reply above is spot on and more detailed on
this front.)

Similarly, if a style parameter or the like indicated whether the
multi-select or concatenation behavior were in effect and actually
controlled the behavior of function calls like template() and file(),
I'd be surprised and confused (and probably angry).  Those function
calls should behave the same way in any context.

Here comes the radical part: what if we deprecated the content
parameter, the template() function, and the file() function?  In their
place we add parameters called template and file (maybe a better name
for that one).  These, along with the source parameter, accept a
string that is resolved to a pathname or an array that resolves to
multiple pathnames.  The style (for lack of a better name) parameter
chooses multi-select or concatenation behavior.  For example:

    file {
        "/foo":
            template => "module/foo";
        "/bar":
            source => ["puppet:///module/bar", "puppet:///module/bar2"],
            style => select;
        "/baz":
            file => ["module/baz-header", "module/baz-body",
"module/baz-footer"],
            style => concat;
    }

There is precedent for one parameter affecting the behavior of
another: exec's path and cwd parameters have a good deal to say about
what the named command actually does.  Precedent aside, I don't think
it's surprising to users that the parameters given to a resource work
together to satisfy it.

It surely wouldn't be easy to get rid of the content parameter, and
the template() and file() functions but I think it's worth a
discussion.

Rich

-- 
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.

Reply via email to