Is there a way to read multiple hiera file from a datadir location?

164 views
Skip to first unread message

Sans

unread,
Dec 2, 2015, 1:09:18 PM12/2/15
to Puppet Users
Hi all,

Is there way to use multiple Hiera data-source yaml from a fixed location like: /etc/puppet/sites/clients/ ?

I see having something like this:

:hierarchy:
    - "clients/*"
    - default


doesn't really work for Hiera. The issues for me There gonna be 100s of .yaml in there and I don't want to over load my hiera.yaml with 100s of entries or edit that file every time we add new client's data. Or is there way to use RegEx name? I don't care in what order they are executed. How do I deal with this situation? Best!

Henrik Lindberg

unread,
Dec 2, 2015, 5:42:31 PM12/2/15
to puppet...@googlegroups.com
On 2015-02-12 19:09, Sans wrote:
> Hi all,
>
> Is there way to use multiple Hiera **data-source yaml from a fixed
> location like:/etc/puppet/sites/clients/ ?
>

No.

> I see having something like this:
>
> :hierarchy:
> - "clients/*"
> - default
>
>
> doesn't really work for Hiera. The issues for me There gonna be 100s of
> .yaml in there and I don't want to over load my hiera.yaml with 100s of
> entries or edit that file every time we add new client's data. Or is
> there way to use RegEx name? I don't care in what order they are
> executed. How do I deal with this situation? Best!
>

Add a build step that concatenates/combines all of your data files into
one file. Reference that file in your hiera.yaml.

Alernatively write your own backend that loads all of the files and
merges the result.

- henrik

> --
> 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...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/64150920-abb5-4508-9c5e-7dddea97dd50%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/64150920-abb5-4508-9c5e-7dddea97dd50%40googlegroups..com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

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

Reply all
Reply to author
Forward
0 new messages