2015-03-25 94 views
0

我正在測試木偶「文件」類型。我添加了一個簡單的表現爲以下木偶文件類型

[email protected]:/etc/puppet/manifests# cat site.pp 
file { '/tmp/puppettest' : 
     source => "pk121.domain:///files/f1.txt", 
} 

嘗試應用的高手,但得到以下錯誤

[email protected]:/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 

[email protected]:/etc/puppet/manifests# ls -al ../files/f1.txt 
-rw-r--r-- 1 root root 19 Mar 25 14:52 ../files/f1.txt 

編輯

它工作正常本地,但我仍然感到不能夠代理上的同步f1.txt,以下是主設備上的新配置

[email protected]:/etc/puppet/environments/production/manifests# vi site.pp 
    node default { 
    file { '/tmp/puppettest' : 
      source => "pk121.domain:///files/f1.txt", 
    } 
    } 

代理

[email protected]:~# 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 

如果您需要更多信息,請讓我知道。

回答

1

您的URI格式錯誤,並嘗試將您的節點FQDN用作地址架構。

儘量只用香草

puppet:///files/f1.txt 

當本地系統上使用puppet apply,你可以想見,也只是從一個磁盤位置同步文件到另一個。

source => 'file:///etc/puppet/files/f1.txt' 

source => '/etc/puppet/files/f1.txt' 
+0

pk121.domian是我的主人,我有嘗試使用pk121和pk121.domain,但兩者給我同樣的錯誤。 – 2015-03-26 13:31:26

+0

是的,但是您的URI無法正常工作,就像您無法通過google.com:// www所達到的一樣。 – 2015-03-26 17:37:29

+0

那麼,我可以使用什麼,我不能在文檔中看到任何其他選項。 – 2015-03-27 06:06:30