【问题标题】:hiera merging not workinghiera合并不起作用
【发布时间】:2014-11-20 10:45:06
【问题描述】:

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

然后我有: common.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 .. . 我做错了什么?

问候

【问题讨论】:

    标签: puppet hiera


    【解决方案1】:

    要启用array merging,您需要添加--array 选项。

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

    【讨论】:

    • @user1908375 如果此解决方案解决了您的问题,请接受。
    猜你喜欢
    • 2017-08-31
    • 2011-03-13
    • 2017-05-07
    • 2022-01-19
    • 2012-03-12
    • 2016-08-19
    相关资源
    最近更新 更多