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
}
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