假设在我的木偶大师身上,我可以从命令行运行hiera来查看特定的节点如何生成一个variables集合,但是真的很难find一个可行的例子。
我试过使用木偶库存和使用mcollective,两个都有一个错误:
[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
search这些错误信息发现一些旧的错误和修复,但没有任何工作会给我一个testing查询。
当你得到意想不到的价值时,你如何testing和debuggingheira查找?
您不能转储节点的整个hiera数据。 如果你看看为hiera创build自定义后端的api,你将会看到没有任何东西可以返回整个数据集或者键列表,只是一种获取与特定键相关的值的方法。 请记住,广泛的后端是可能的。
您可以查找特定键的值。 例如:
hiera -c /etc/puppet/hiera.yaml \ key \ fqdn=pamcontent001.mgs.example.com \ environment=production
您需要提供哪种范围的variables将取决于您在hiera.yaml文件中使用的variables。 你可能会觉得这很有用。