On 2014-04-07 22:29, Igor Galić wrote:
perhaps a better way to summarize this issue is this:

     define httpd::mod (
       $ensure   = 'enabled',
       $instance = 'default',
       $module   = $title,
       $package  = undef,
     ) {

     }

This definition of httpd::mod's interface is static.
it's a static map (Hash). If we pass any additional parameters
it'll blow up, and rightfully so.

What I wanted with this:


     define httpd::mod (
       $ensure   = 'enabled',
       $instance = 'default',
       $module   = $title,
       $package  = undef,
       $*  # all others
     ) {

(or whatever the syntax) was a dynamic interface. A way to
programmatically define that map.


The issue here is that we cannot have a user defined type that has a different set of parameters for different instances (which would be the case here since different instantiations can create instances with very different sets of parameters). The only way to do this is to define the last parameter as a Hash, and pass the additional parameters as such.

You can use the type system to check the validity of the content of the hash (when using the future parser).

- henrik


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/lp7ebu%24bhi%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to