Hi,
I thinking about how I could use hiera and I cant work it out, so I
would like to ask for some enlightenment.

class a {... $x = hiera('x') ...}
define a::b ( $x = hiera('x') {...}
define a::c ( $x = hiera('x') {...}

include a
a::b { "b": }
a::c { "c": }

so I thought about a directory structure similar to the following,
assuming the yaml backend for now.

datadir/a/a::b/b.yaml
datadir/a/a::c/c.yaml
datadir/a/a.yaml

to achieve this I would do something like this in hiera.yaml

:hierarchy:
            - %{module_name}/%{XXX}/%{name}
            - %{module_name}/%{module_name}

Question 1: What do I fill in for %{XXX} that it expands to 'a::b' 'a::c' ?

And what if in addition I want to use the puppet backend? How do I
specify defaults. For class a I can do

class a::data { $x = 'bla' }

Question 2: But where would I specify defaults for a::b and a::c ?
And Question 3, finally: Does it make sense to you what I am trying to
do, actually?

-- 
Kind Regards, Markus

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to