安装foreman时,hiera对puppet舱单没有价值

安装foreman时,hiera对puppet舱单没有价值,puppet,hiera,theforeman,Puppet,Hiera,Theforeman,如果试图从模块中获取数据,使用调用_类,数据不会出现在puppet清单中,如果将变量设置为common或osfamily,则manifets将提供yaml文件值。 我的环境: 木偶大师3.7.4+工头1.7+希拉1.3.4 希拉配置: --- :backends: - yaml :hierarchy: - "%{::environment}/node/%{::fqdn}" #node settings - "%{::environment}/profile/%{calling

如果试图从模块中获取数据,使用调用_类,数据不会出现在puppet清单中,如果将变量设置为common或osfamily,则manifets将提供yaml文件值。 我的环境: 木偶大师3.7.4+工头1.7+希拉1.3.4 希拉配置:

    ---
:backends:
  - yaml
:hierarchy:
  - "%{::environment}/node/%{::fqdn}" #node settings
  - "%{::environment}/profile/%{calling_class}" # profile settings
  - "%{::environment}/%{::environment}" # environment settings
  - "%{::environment}/%{::osfamily}" # osfamily settings
  - common # common settings
:yaml:
  :datadir: '/etc/puppet/hiera'
/etc/puppet/hiera/production/profile/common.yaml

在profile模块manifest/etc/puppet/environments/production/modules/profile/manifests/common.pp上

Puppet config/etc/Puppet/Puppet.config

更有趣的是,如果在没有foreman的情况下部署相同的代码,它就会工作。
也许我错过了一些配置或插件

您的示例文件夹结构中需要一个生产环境,如下所示:

/etc/puppet/hiera/environments/production/node/%{::fqdn}.yaml
/etc/puppet/hiera/environments/production/profile/%{calling_class}.yaml
/etc/puppet/hiera/environments/production/production/*.yaml
/etc/puppet/hiera/environments/production/%{::osfamily}.yaml
/etc/puppet/hiera/environments/common.yaml
因此,您粘贴的环境路径也是错误的

/etc/puppet/hiera/production/profile/common.yaml
旁注 根据第一个视图,不应将hieradata与modulepath混合,因此如果可以,请将模块移出basemodulepath

basemodulepath   = /etc/puppet/environments/common
使用粘贴的puppet.conf,真实的概要文件模块路径位于以下三个文件夹之一:

/etc/puppet/environments/common/modules/profile
/etc/puppet/modules/profile
/usr/share/puppet/modules/profile

我相信我也有同样的问题,同样版本的木偶/工头/希拉。如果我执行hiera-c/etc/puppet/hiera.yaml classes role=test,我会得到层次结构的正确返回,但是我的节点签入,什么也没有发生。我通过passenger打开了puppet上的调试日志,它似乎加载了正确的hiera.yaml,但实际上什么都没有发生。我想你看错了。。。datadir+层次结构将是/etc/puppet/hiera/production/nodei如果您再次阅读,您将知道我的答案是解决问题并提供建议。
/etc/puppet/hiera/production/profile/common.yaml
basemodulepath   = /etc/puppet/environments/common
/etc/puppet/environments/common/modules/profile
/etc/puppet/modules/profile
/usr/share/puppet/modules/profile