Hiera does not work

I am trying to implement hiera merging. hier is my hiera.yaml

---
:hierarchy:
 - fqdn/%{fqdn}
 - roles/%{role}
 - os/%{osfamily}
 - common
:backends:
 - yaml
# options are native, deep, deeper
:merge_behavior: deeper
:yaml:
 :datadir: /etc/puppet/environments/%{environment}/data

      

then I have: common.yaml

---
classes: 
 - a
 - b 

      

and fqdn / some.host.yaml

---
classes: 
 - c
 - d

      

works

hiera --debug -c /etc/puppet/hiera.yaml classes fqdn=some.host environment=development
["c", "d"]

      

and

hiera --debug -c /etc/puppet/hiera.yaml classes fqdn=blablahost environment=development
["a", "b"]

      

so "blablahost" uses common.yaml and applies classes "a" and "b" .. but fqdn = some.host should use a, b, c, d .. and not only c, d .. What am I doing wrong?

Hello

+3


source to share


1 answer


To enable array merge you need to add a parameter --array

.



hiera --array -c /etc/puppet/hiera.yaml classes fqdn=some.host environment=development

      

+5


source







All Articles