【发布时间】:2016-10-07 12:43:54
【问题描述】:
我仔细检查了所有设置,但没有发现问题,这就是我尝试在这里寻求帮助的原因。
让我展示一下配置:
puppet.conf:
[...]
[master]
environmentpath = $confdir/environments/
hiera_config = $confdir/environments/production/sites/xy/config/hiera.yaml
default_manifest = ./sites/xy/config/
environment_timeout = 0
fileserver.conf:
[...]
[sites]
path /etc/puppet/environments/production/sites/
allow *
auth.conf:
[...]
# extra mountpoint
path /sites
allow *
[...]
现在每当我运行 Puppet 并尝试实现特定文件时,我都会得到:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find any files from puppet:///sites/xy/files/xy/xy.key.pub at /etc/puppet/environments/production/modules/xy/manifests/xy.pp:88 on node xy
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
请注意,我必须用 xy 替换敏感信息,但出于调试目的,我会尽可能提供所有细节。
所以/sites 根据fileserver.conf 指向/etc/puppet/environments/production/sites/ 并且目录是这样存在的(具有正确的权限恕我直言):
/etc/puppet % ls -ld /etc/puppet/environments/production/sites/
drwxr-xr-x 8 root puppet 4096 Oct 7 12:46 /etc/puppet/environments/production/sites/
因此,提到的文件puppet:///sites/xy/files/xy/xy.key.pub 应位于/etc/puppet/environments/production/sites/xy/files/xy/xy.key.pub,如下所示:
/etc/puppet % ls -l /etc/puppet/environments/production/sites/*/files/*/*.key.pub
-rw-r--r-- 1 root puppet 725 Oct 7 12:46 /etc/puppet/environments/production/sites/xy/files/xy/xy.key.pub
并且在错误消息中提到了加载文件的模块的第 88 行,它看起来像这样:
$sshpubkey = file("puppet:///${sitefiles}/xy/${s0_pubkey}")
其中$s0_pubkey 是xy.key.pub 和${sitefiles} 是sites/$site/files,这导致请求文件的评估路径如下:puppet:///sites/xy/files/xy/xy.key.pub
【问题讨论】:
标签: puppet