2014-02-24 33 views
0

我是Puppet的新手,只是面對非常不尋常的問題,我的Puppet master正在運行,並且所有代理都完全配置爲該主控。木偶配置無處不在

文件中傀儡師:

現在,這裏是我的site.pp文件:

class fileForNodeA{ 

    file { "/tmp/hello.txt" : 
     content => "This is hello.txt" 
    } 
} 

class fileForNodeB{ 
    file{ "/tmp/hello.txt" : 
     content => "This is hello1.txt" 
    } 
} 

node 'NodeA'{ 
    include fileForNodeA 
} 

node 'NodeB'{ 
    include fileForNodeB 
} 

現在客戶端的主機名分別爲nodeA和基站:

在NodeA或基站當我說:

puppet agent --no-daemonize --verbose --waitforcert 60 --test 

這表明該

Could not retrieve catalog from remote server : Error 400 on server : Could not find| 
default node or by name with 'NodeA.com' ..... 
Notice : Using cached catalog 
Info : Applying configuratiuon version '1234567890' 
Notice : Finished catalog run in 0.06 seconds 

此聲明後,當我瀏覽目錄/tmp目錄它說,兩個文件分別是hello.txt的hello1.txt,我有點困惑時跟它「找不到..blah blah「,那爲什麼它同時適用於NodeA和NodeB的部分?

請大家澄清一下,如果我做錯了如何根據節點設置來配置這些東西?

請幫助>>>感謝AV

回答

4

請您site.pp添加此作爲一線

節點默認{}

享受。

+0

真棒帖子....牛眼... :P –

+0

照顧精心製作? :) – cassianoleal

+2

傀儡客戶端,當連接到主​​時,尋找默認配置,並在沒有它應用完整的配置。 一旦您指定了默認配置傀儡客戶端不會中斷並找到其配置並應用。 Puppet開發者應該對此做點什麼。 – Rishi