我正在尝试实现 hiera 合并。 hier 是我的 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
然后我有: 通用.yaml
---
classes:
- a
- b
和 fqdn/some.host.yaml
---
classes:
- c
- d
运行
hiera --debug -c /etc/puppet/hiera.yaml classes fqdn=some.host environment=development
["c", "d"]
和
hiera --debug -c /etc/puppet/hiera.yaml classes fqdn=blablahost environment=development
["a", "b"]
所以“blablahost”采用 common.yaml 并应用“a”和“b”类..但是 fqdn=some.host 应该应用 a,b,c,d.. 而不仅仅是 c,d.. .我做错了什么?
问候
最佳答案
启用array merging ,你需要添加--array
选项。
hiera --array -c /etc/puppet/hiera.yaml classes fqdn=some.host environment=development
关于puppet - hiera 合并不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26042333/