On Wednesday, December 11, 2013 11:03:33 PM UTC-6, William Leese wrote:

Facter was designed before hiera. It serves a larger purpose than just
usage as hiera hierarchy conditionals.

I get that.
Do I understand correctly that your custom fact which "spits out a list of
server types" returns more than 1 item in a comma separated list like the
filesystems example you provided?

Exactly. I used the filesystems example for simplicity (you can try it
without setting up a custom fact), and because it has exactly the same
behavior as my target fact.

Looking at the nature of this custom fact would it not be better if it
provided a single 'server type'? If this is impossible, you could split the
fact into X facts and (servertype1,servertype2 and servertype3) which could
then be used nicely in hiera.

To make this work in hiera I'd need a hierarchy like:
   - "groups/%{servertype1}"
   - "groups/%{servertype2}"
   - "groups/%{servertype3}"

It's clunky, but the more I think about it, the more I think that's the
only way to do this. I just realized that hiera doesn't have any way to
iterate over the list handed to it from facter. So if my servertype fact is
equal to git,ntp,ldap (for example), then I can't expect hiera to do a
lookup with the fact servertype set to git, then another lookup with the
fact servertype set to ntp, etc. I think it's reasonable to *want* this
behavior, but it's not what it does (for now, at least).

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 puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/408ffd33-88c2-424c-b80d-4c462fd5185b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
grouppuppet-users @
postedDec 11, '13 at 10:33p
activeDec 12, '13 at 2:20p

2 users in discussion

Paul Archer: 2 posts William Leese: 1 post



site design / logo © 2022 Grokbase