On 10/16/2014 09:33 PM, Kenton Brede wrote:
> I'm using OS Puppet 3.7.1.  I'm using Hiera and *mostly* have our site
> specific data out of our modules.
>
> I could use some advice on how to handle the following two cases.
>
> Case #1
>
> node basenode {
>   include files   # files common to all nodes
> }
>
> node 'hostname.example.com <http://hostname.example.com>' inherits
> basenode {
>   include files::hostname  # files specific to host
> }
>

node basenode {
    hiera_include('classes')
}

Your hierarchy should have

classes: files

on a common level and

classes: files::%{hostname}

on a level where it only applies to such nodes that have such a class.
This might well be the node specific level (i.e., the top of your
hierarchy).

> Case #2
>
> In template files, flow control like:
>
> <% if (hostname == "hostname1") -%>
> X11Forwarding yes
> <% else -%>
> X11Forwarding no
> <% end -%>
>
>

X11Forwarding <%= scope.function_hiera('ssh::x11_forwarding', 'no') %>

Set this Hiera key to 'yes' for each node that should get it.

HTH,
Felix

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/545A9567.8030700%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to