puppet - hiera 合并不起作用

标签 puppet hiera

我正在尝试实现 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/

相关文章:

puppet - Puppet 中的 Exec 序列

elasticsearch - Puppet elasticsearch 模块(类与定义)

namespaces - 按模式查找 hiera 配置

yaml - 从 puppet 代码(或 "puppet lookup"cmd)访问多个嵌套的hiera值

puppet - 在 puppet 中使用多个 hiera.yaml 文件

git - Puppet 代理无法从 Git 下载代码

ubuntu - 通过 Apt 模块使用 puppet 在 Ubuntu 上安装 spotify-client

recursion - puppet 递归目录创建

ubuntu - vagrant puppet 符号链接(symbolic link)问题

list 中的 Puppet Hiera 查找不起作用