This is sort of an RFC. I know that this problem can be solved with
storedconfigs, I simply really dislike the whole storedconfigs workflow; I
like the hiera system of having a bunch of editable files that describe my
setup, rather than having to rely on what might or might not have been put
into a database by some hosts at some time in the past.
I love Hiera, I think it's fantastic. Where I get into trouble is with
wanting to use it as an inventory system, i.e. being able to do things like
"list all the IPs of all our hosts".
In the past I've done this by having a giant "hosts" hash inside Hiera, and
that's OK, but it loses me all of the hierarchical override aspects of
Hiera, which is lame. I've hit a situation where I've got a key that I
would like to be available for inventory recording purposes, but I would
*also* like to override at a particular level in the hierarchy (e.g. the
default for this value is 2, but for all dev hosts the value should be 1,
*and* I want to be able to say "list this value for all hosts).
I'd like something better than what I've got.
The best idea I've had so for is to make a function, tentatively called
hiera_multi, that goes like this:
hiera_multi( 'fqdn', [ 'host1', 'host2' ], [ 'ipv4', 'memcached::enabled',
'tomcat::server_count' ] )
and it returns a hash like:
{ host1 => { 'ipv4' => '1.2.3.4', 'memcached::enabled' => true, ... } ... }
which is each of those items, as hiera lookups, from the point of view of
each of those fqdn values, as though I had done a whole bunch of:
$ hiera 'ipv4' ::fqdn=host1
or similar.
Does this seem like a reasonable solution? Can anyone think of anything
better?
What I'd really like to do is *not* give the list of hiera keys, and have
it return *every* hiera key in the system for every entry, but I don't
think that's reasonably possible as hiera is written, and that's fine.
-Robin
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev.
For more options, visit https://groups.google.com/groups/opt_out.