I love Automatic Parameter Lookup (APL) and hiera in general.  But one 
thing I have found awkward is that `lookup_options` are found in the hiera 
data.  In general the idea is to separate data from code right?  Lookup 
options do not feel like data to me, but more like something I would find 
in the code the same way in the code I can type class parameters.

*Proposal*

Create a data type (or function perhaps that returns a data type) that 
tells the APL code HOW to do the lookup.  The lookup key is just the 
class/name of the current param and the rest of the arguments could behave 
like lookup().

class froboz(
  Array[String] $my_param = LookupOptions('unique'),
  Hash          $options  = LookupOptions('deep', knockout_prefix=>'-', 
default_value=>undef),
) {# Do Useful Stuff}

Or maybe just *Lookup* with a capital *L* or perhaps a function 
*lookup_options()* that returns some internal class/data type that need not 
be visible to the puppet user.

class bozfro(
  $some_param    = Lookup(Array[String], 'unique', undef),
  $another_param = lookup_options(Hash, 'deep', {knockout_prefix => '-'}),
) {# Do Useful Stuff}

Do you think lookup_options seem out of place in the hiera data?
Would it make more sense as a Data Type or a function() w/ some invisible 
data type that APL uses?
Does this belong in puppet proper?  Stdlib? (Could it go in stdlib?)

Please discuss.

-Alan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/50a3ed15-92e1-42f4-99e5-833dd3d12710%40googlegroups.com.

Reply via email to