![初始 Puppet 设置问题-filebucket 权限?](https://linux22.com/image/590703/%E5%88%9D%E5%A7%8B%20Puppet%20%E8%AE%BE%E7%BD%AE%E9%97%AE%E9%A2%98-filebucket%20%E6%9D%83%E9%99%90%EF%BC%9F.png)
我正在尝试设置初始 Puppet 配置,但由于文件存储桶中的第一个文件出现故障,因此很难使其正常工作。乍一看一切都很好,我想我需要第二个意见才能发现问题。所以我在 nodes.pp 中定义了节点,如下所示:
# cat /etc/puppet/manifests/nodes.pp
node defaultclass {
include baseconfig
}
node 'buildmirror.briggs.uk.to' {
include ntp
include packages
}
我的文件桶位于此处:
# cat /etc/puppet/modules/baseconfig/manifests/ntp.pp
class ntp {
file { "/etc/ntp.conf":
source => "puppet:////modules/baseconfig/ntp.conf",
owner => root,
group => root,
mode => 644,
require => Package ["ntp"]
}
#file { "/var/log/ntp":
#ensure => directory,
#owner => ntp,
#group => ntp,
#mode => 755,
#}
service { "ntpd":
require => File["/etc/ntp.conf"],
subscribe => File["/etc/ntp.conf"],
ensure => running,
enable => true,
}
}
并且该文件存在于正确的目录中(我认为)
# ls -al /etc/puppet/modules/baseconfig/files/ntp.conf
-rwxr-xr-x 1 root root 1862 Jul 20 15:50 /etc/puppet/modules/baseconfig/files/ntp.conf
我遇到的问题是,当我运行 puppetd --test 时出现以下错误:
# puppetd --test
info: Retrieving plugin
info: Caching catalog for hostname
info: Applying configuration version '1342971406'
err: /Stage[main]/Ntp/File[/etc/ntp.conf]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:////modules/baseconfig/ntp.conf at /etc/puppet/modules/baseconfig/manifests/ntp.pp:8
notice: /Stage[main]/Ntp/Service[ntpd]: Dependency File[/etc/ntp.conf] has failures: true
warning: /Stage[main]/Ntp/Service[ntpd]: Skipping because of failed dependencies
notice: Finished catalog run in 0.34 seconds
这可能是什么原因造成的?我已经验证了文件存储桶中文件的权限(甚至尝试将其设置为 777 以确保这不是权限问题)任何帮助表示感谢!
答案1
斜线太多——请尝试puppet:///modules/baseconfig/ntp.conf
用 代替puppet:////modules/baseconfig/ntp.conf
。
简单介绍一下术语 - 文件存储桶实际上是客户端用来存档被替换文件的旧版本的机制。您在这里使用的只是所谓的“文件服务器”。