大网数据广告活动
服务器运维问答

Using Foreman's host groups in hiera.yaml :hierarchy section

· 52CE 我爱测

Does anyone know how to set a correct path in :hierarchy section of hiera.yaml config to apply configuration to Foreman's host groups? I tried to use this settings with %{::hostgroup} variable, but it didn't work for me: https://…

问题原文

原帖链接 · patok · CC BY-SA 3.0

Does anyone know how to set a correct path in :hierarchy section of hiera.yaml config to apply configuration to Foreman's host groups? I tried to use this settings with %{::hostgroup} variable, but it didn't work for me: https://github.com/aldavud/hiera-sat6/blob/master/docs/satellite6_hiera.md

Is this specific only to Satellite? Should I use different version(s) of Hiera/Puppet/Foreman? Any idea? :)

We are currently using Hiera 3.3.2, Puppet 4.10.9 and Foreman 1.15.6.

thx

已采纳解答

原帖链接 · patok · CC BY-SA 3.0

I have got a solution...

At first I looked to puppetserver process with strace, and after running puppet agent on managed host I saw this in its output:

[pid  7997] stat("/etc/puppetlabs/code/environments/development/hieradata/hostgroup/PROD/ubuntu/rabbitmq.yaml", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0
[pid  7997] stat("/etc/puppetlabs/code/environments/development/hieradata/hostgroup/PROD/ubuntu/rabbitmq.yaml", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0
[pid  7997] stat("/etc/puppetlabs/code/environments/development/hieradata/hostgroup/PROD/ubuntu/rabbitmq.yaml", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0
[pid  7997] stat("/etc/puppetlabs/code/environments/development/hieradata/hostgroup/PROD/ubuntu/rabbitmq.yaml", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0
[pid  7997] stat("/etc/puppetlabs/code/environments/development/hieradata/hostgroup/PROD/ubuntu/rabbitmq.yaml", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0
[pid  7997] open("/etc/puppetlabs/code/environments/development/hieradata/hostgroup/PROD/ubuntu/rabbitmq.yaml", O_RDONLY) = 37

Then we realized that rabbitmq.yaml is not well written, so after making some changes the host gets its configuration. And that's it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-02-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。