linux – Satellite 6的puppet无法找到hiera数据源

linux – Satellite 6的puppet无法找到hiera数据源,第1张

概述使用随Foreman 1.6.0.53附带的Satellite 6. 默认情况下,Puppetlabs的documentation声明hiera配置应该在$config / hiera.yaml中. # puppet config print confdir hiera_configconfdir = /etc/puppethiera_config = /etc/puppet/hiera.ya 使用随Foreman 1.6.0.53附带的Satellite 6.

默认情况下,Puppetlabs的documentation声明hIEra配置应该在$config / hIEra.yaml中.

# puppet config print confdir hIEra_configconfdir = /etc/puppethIEra_config = /etc/puppet/hIEra.yaml

看看我们的hIEra配置:

# cat /etc/puppet/hIEra.yaml---:backends: yaml:yaml:  :datadir: /var/lib/hIEra:hIErarchy:  - users  - groups  - global

数据文件存在:

# cat /var/lib/hIEra/users.yaml---users:  bfernandez:    uID: 300    fullname: Belmin Fernandez

而且,为了测试它,我使用hIEra的Cli和木偶申请:

# hIEra --conf=/etc/puppet/hIEra.yaml --deBUG -h usersDEBUG: 2015-05-06 14:11:37 -0400: HIEra YAML backend startingDEBUG: 2015-05-06 14:11:37 -0400: Looking up users in YAML backendDEBUG: 2015-05-06 14:11:37 -0400: Looking for data source usersDEBUG: 2015-05-06 14:11:37 -0400: Found users in usersDEBUG: 2015-05-06 14:11:37 -0400: Looking for data source groupsDEBUG: 2015-05-06 14:11:37 -0400: Looking for data source global{"bfernandez"=>{"uID"=>300,"fullname"=>"Belmin Fernandez"}}# puppet apply -e '$foo = hIEra_hash(users) notify { $foo: }'Notice: Compiled catalog for foosat.example.com in environment production in 0.08 secondsNotice: {"bfernandez"=>{"uID"=>300,"fullname"=>"Belmin Fernandez"}}Notice: /Stage[main]/Main/Notify[{"bfernandez"=>{"uID"=>300,"fullname"=>"Belmin Fernandez"}}]/message: defined 'message' as '{"bfernandez"=>{"uID"=>300,"fullname"=>"Belmin Fernandez"}}'Notice: Finished catalog run in 0.30 seconds

到目前为止,一切看起来都很好但是,当我在模块中引用hIEra_hash(‘users’)并将其应用于节点时,我收到此错误:

May  6 13:49:04 foo1 puppet-agent[8688]: Could not retrIEve catalog from Remote Server: Error 400 on SERVER: Could not find data item users in any HIEra data file and no default supplIEd at /etc/puppet/modules/accounts/manifests/init.pp:10 on node foo1.example.com

关于我应该看什么的任何想法?感觉就像我在Foreman方面遗漏了一些东西.

更新1:

根据@lsd,尝试使用/etc/hIEra.yaml作为配置,而不是通过创建符号链接.使用hIEra Cli对其进行测试以确认配置:

# hIEra --conf=/etc/hIEra.yaml --deBUG -h usersDEBUG: 2015-05-06 14:31:13 -0400: HIEra YAML backend startingDEBUG: 2015-05-06 14:31:13 -0400: Looking up users in YAML backendDEBUG: 2015-05-06 14:31:13 -0400: Looking for data source defaultsDEBUG: 2015-05-06 14:31:13 -0400: Cannot find datafile /var/lib/hIEra/defaults.yaml,skipPingDEBUG: 2015-05-06 14:31:13 -0400: Looking for data source usersDEBUG: 2015-05-06 14:31:13 -0400: Found users in usersDEBUG: 2015-05-06 14:31:13 -0400: Looking for data source groupsDEBUG: 2015-05-06 14:31:13 -0400: Looking for data source global{"bfernandez"=>{"uID"=>300,"fullname"=>"Belmin Fernandez"}}

但仍然在代理上出现错误,因此没有解决问题.

解决方法 在我的通勤上考虑它后,决定检查SElinux,那里是:
[root@foosat hIEra]# grep yaml /var/log/audit/audit.log | head -n1type=AVC msg=audit(1430926955.728:75727): avc:  denIEd  { getattr } for  pID=17099 comm="ruby" path="/var/lib/hIEra/users.yaml" dev="dm-2" ino=25185161 scontext=system_u:system_r:passenger_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file

将hIEra文件上的文件上下文更改为puppet_etc_t(如果有人知道更合适的内容,请发表评论):

[root@foosat hIEra]# semanage fcontext -a -s system_u -t puppet_etc_t "/var/lib/hIEra(/.*)?"[root@foosat hIEra]# restorecon -R -v .restorecon reset /var/lib/hIEra/users.yaml context unconfined_u:object_r:var_lib_t:s0->unconfined_u:object_r:puppet_etc_t:s0

现在工作.希望这有助于其他人.

总结

以上是内存溢出为你收集整理的linux – Satellite 6的puppet无法找到hiera数据源全部内容,希望文章能够帮你解决linux – Satellite 6的puppet无法找到hiera数据源所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1039641.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存