----- Original Message -----
> r...@devco.net ("R.I.Pienaar") writes:
> 
> > ----- Original Message -----
> > > john.bollin...@stjude.org (jcbollinger) writes:
> > > 
> > > Perhaps. To some extend my non-parameterised classes are _very_
> > > similar
> > > in many ways except for various parameters (creation of logical
> > > volumes
> > > and filesystems, version of mysql to use, creation of certain
> > > cron jobs
> > > for importing informtation into a configuration database, and
> > > other crons
> > > for doing standard jobs, etc....) Most of the "completely common"
> > > stuff
> > > has been taken out. However, using extlookup() doesn't really
> > > work for
> > > me "right now" for a simple reason I haven't yet mentioned. I'd
> > > further
> > > like to have a lookup_by_key() function [let's say similar to the
> > > extlookup()
> > > one provided now] but also a lookup_by_regexp() function where I
> > > can match
> > > groups of boxes, in my case mainly based on regexps of their
> > > hostnames
> > > rather than on specific $hostname, or $domain, etc.... Without
> > > that
> > > I need to add more entries to match by lots of hostnames, which
> > > doesn't work.
> > 
> > I think you're really trying to just avoid thinking in the puppet
> > way instead
> > trying to force some previous ideas on how things should work on it
> > rather
> > than figure out how it works.
> > 
> > For example, you could just define a fact on your machines that
> > indicate what
> > role they have - perhaps based on your regex hostnames - and then
> > use that in
> > extlookup to select csv file to use.  That would achieve your goal
> > and it would
> > be the puppet way of solving it.
> 
> Currently I build nodes.pp from an external source and that provides
> the node with it's basic class (and hence role). So that's not
> needed.

so if you just set a variable in the node scope you can use those in 
extlookup as I described - much simpler than writing an entire new type
of function.

And combine this with the optional paramter to extlookup that let you 
specify a search-first file and you get additional key/dimension you
wish.

Still, just write the functions you need - sounds like you know exactly
what you want and its quite specific so just impliment it :)

If its good and all, you can share it on forge.puppetlabs.com

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to