I'm trying to use the scope node variable in my hiera.yaml configuration, which apparently should be relatively simple, but it just doesn't work for me Lol
With hiera.yaml like this:
---
:backends:
- yaml
:yaml:
:datadir: /etc/puppet/hieradata
:hierarchy:
- nodes/%{::hostname}
- builds/%{build}
- common
And my .pp site looks like this:
hiera_include('classes')
node 'mynode' {
$build = special
}
And other yaml files,
common.yaml:
classes:
- first_class
- second_class
builds / special.yaml:
classes:
- third_class
I would expect "mynode" to get a "third class" when the puppet is updated, but it does not and does not give an error.
Running the hiera command gives me the correct result (I think):
$ hiera classes
["first_class","second_class"]
$ hiera classes build=special
["third_class"]
Is there something obvious that I did wrong?
It works %{::hostname}. If I add the /mynode.yaml nodes, this config will be raised.
source
share