据推测,在我的傀儡主人上,我可以从命令行运行hiera,以查看特定节点将如何生成变量集,但是很难找到这样的工作示例。
我试过使用木偶目录和puppet,这两种方法都有错误:
[root@puppet001 hiera]# hiera -c /etc/puppet/hiera.yaml -i pamcontent001.mgs.example.com
Puppet inventory service lookup failed: NoMethodError: undefined method `features' for Puppet:Module
Could not load Puppet inventory service scope: SystemExit: exit
[root@puppet001 hiera]# hiera -c /etc/puppet/hiera.yaml -m pamcontent001.mgs.example.com
MCollective lookup failed: LoadError: cannot load such file -- mcollective
Could not load MCollective scope: SystemExit: exit搜索这些错误消息可以发现一些旧的错误及其修复,但是没有任何工作可以让我进行测试查找。
当您得到意外值时,如何测试和调试heira查找?
发布于 2016-03-08 13:09:49
不能为节点转储整个hiera数据。如果您查看为hiera创建自定义后端的api,就会发现没有什么可以返回整个数据集或键列表,这只是获取与特定键关联的值的一种方法。请记住,一个广泛的后端是可能的。
您可以查找特定键的值。例:
hiera -c /etc/puppet/hiera.yaml \
key \
fqdn=pamcontent001.mgs.example.com \
environment=production您需要以这种方式提供的作用域变量具体取决于您在hiera.yaml文件中使用的变量。您可能会发现这很有用。
https://serverfault.com/questions/722776
复制相似问题