2015-04-04 42 views
0

我在從puppet agent檢索文件時遇到問題。我正在運行木偶大師3.7版本。這是我的結構:傀儡環境:參數源文件失敗

. 
|-- auth.conf 
|-- environments 
| |-- dev 
| | |-- environment.conf 
| | |-- manifests 
| | | `-- site.pp 
| | `-- modules 
| |  `-- common 
| |   |-- files 
| |   | `-- profile 
| |   |-- manifests 
| |   | `-- init.pp 
| |   `-- staticFiles 
| |    `-- profile 
| |-- prod 
| | |-- environment.conf 
| | |-- manifests 
| | | `-- site.pp 
| | `-- modules 
| |  `-- common 
| |   `-- manifests 
| |    `-- init.pp 
| `-- uat 
|  |-- environment.conf 
|  |-- manifests 
|  | `-- site.pp 
|  `-- modules 
|   `-- common 
|    `-- manifests 
|     `-- init.pp 
|-- etckeeper-commit-post 
|-- etckeeper-commit-pre 
|-- fileserver.conf 
|-- hieradata 
|-- hiera.yaml 
|-- manifests 
|-- modules 
|-- nodes 
`-- puppet.conf 

我的配置是與puppet環境prod,uat和dev。 在開發環境,我有:

manifest = /etc/puppet/environments/dev/manifests/site.pp 
#modulepath = /etc/puppet/environments/dev/modules 
modulepath = site:dist:modules:$basemodulepath 

在木偶客戶的conf,我有: 環境=開發 basemodulepath =的/ etc /傀儡/環境/ $環境/模塊

這裏是我的init常見木偶模塊:

file { "/etc/profile": 
     ensure => "file", 
     mode => 644, 
     owner => "root", 
     group => "root", 
     require => Package["tree"], 
     source => "puppet::///common/profile" 
    } 

在節點我得到這個錯誤: 錯誤:無法應用目錄:參數源失敗的文件[/ etc/profile文件]:不能使用晦澀的URL「傀儡:: ///通用/ profile文件」在/etc/puppet/environments/dev/modules/common/manifests/init.pp:13 包裝異常: 不能使用晦澀的URL '傀儡:: ///通用/個人資料'

即使如果我把源文件,如:

"puppet::///common/staticFiles/profile" 
"puppet::///common/files/profile" 
"puppet::///modules/common/profile" 
"puppet::///modules/common/files/profile" 
"puppet::///modules/common/staticFiles/profile" 

我仍然有同樣的問題!

有誰知道是要解決這個問題嗎?我真的想在/ etc/puppet/environments/dev/modules/common/files /目錄中檢索「profile」文件。

這裏也是我的木偶大師的conf內容:

[main] 
logdir=/var/log/puppet 
vardir=/var/lib/puppet 
ssldir=/var/lib/puppet/ssl 
rundir=/var/run/puppet 
factpath=$vardir/lib/facter 
prerun_command=/etc/puppet/etckeeper-commit-pre 
postrun_command=/etc/puppet/etckeeper-commit-post 
server = puppetmaster01 
certname = puppetmaster01 
environment = prod 
condir = /etc/puppet 
report = true 
show_diff = true 
trace = true 
runinterval=60 
environmentpath=$confdir/environments 
#basemodulepath = $environmentpath/$environment/modules:/etc/puppet/modules:/usr/share/puppet/modules 

[master] 
# These are needed when the puppetmaster is run by passenger 
# and can safely be removed if webrick is used. 
ssl_client_header = SSL_CLIENT_S_DN 
ssl_client_verify_header = SSL_CLIENT_VERIFY 
certname = puppetmaster01 
#modulepath=$confdir/environments/$environment/modules:$confdir/modules 

[agent] 
report  = true 
show_diff  = true 
+1

當然,URL格式存在問題。它應該是'puppet:/// common/profile',第二個':'是不需要的。 – kkamilpl 2015-04-05 17:43:09

+0

我已經試過但它不起作用 – 2015-04-06 10:05:49

回答

0

的URL

puppet:///modules/common/profile 

應該工作。請確保主控上實際啓用了目錄環境。

如果保持一致失敗,請運行

puppet agent --test --trace --verbose --debug 

並粘貼審查適當的服務輸出。

+0

我發佈了輸出 – 2015-04-09 07:37:47