我正在测试puppet" file"类型。我添加了一个简单的清单如下
root@pk121:/etc/puppet/manifests# cat site.pp
file { '/tmp/puppettest' :
source => "pk121.domain:///files/f1.txt",
}
尝试在master上应用,但会出现以下错误
root@pk121:/etc/puppet/manifests# puppet apply site.pp
Notice: Compiled catalog for pk121.domain in environment production in 0.17 seconds
Error: Validation of File[/tmp/puppettest] failed: You cannot specify more than one of content, source, target at /etc/puppet/manifests/site.pp:12
Wrapped exception:
You cannot specify more than one of content, source, target
root@pk121:/etc/puppet/manifests# ls -al ../files/f1.txt
-rw-r--r-- 1 root root 19 Mar 25 14:52 ../files/f1.txt
编辑
它在本地工作正常,但我仍然无法在代理上同步f1.txt,以下是主服务器上的新配置
root@pk121:/etc/puppet/environments/production/manifests# vi site.pp
node default {
file { '/tmp/puppettest' :
source => "pk121.domain:///files/f1.txt",
}
}
代理
root@hire:~# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for hire.domain
Error: Failed to apply catalog: Parameter source failed on File[/tmp/puppettest]: Cannot use URLs of type 'pk121.domain' as source for fileserving at /etc/puppet/environments/production/manifests/site.pp:3
Wrapped exception:
Cannot use URLs of type 'pk121.domain' as source for fileserving
如果您需要任何进一步的信息,请与我们联系。
答案 0 :(得分:1)
您的URI格式错误,并尝试将您的节点FQDN用作地址架构。
尝试使用香草
puppet:///files/f1.txt
在本地系统上使用puppet apply
时,您可以想象也只是将文件从一个磁盘位置同步到另一个磁盘位置。
source => 'file:///etc/puppet/files/f1.txt'
或
source => '/etc/puppet/files/f1.txt'