2015-04-01 27 views
2

我正在嘗試使用我的git存儲庫中的索引文件來覆蓋/var/www/中的默認index.file(隨附於apaceh2)的puppet模塊。我正在使用puppet插件Vcsrepo克隆存儲庫。使用vcsrepo覆蓋/ var/www中的索引文件

vcsrepo { "/var/www/": 
       provider => git, 
       source => "[email protected]*****/testing.git", 
       identity => '/root/.ssh/id_rsa', 
       require => Package['git'], 
     } 

我現在收到此錯誤:

Error: /Stage[main]/Web::Repository/Vcsrepo[/var/www/]: Could not evaluate: undefined method `include?' for nil:NilClass 

我與force=>"true"試過,不設法解決這個問題。

回答

0

這樣做的最簡單方法是將git存儲庫克隆到其他位置,然後使用file資源將index.file作爲版本的副本或符號鏈接。

vcsrepo { "/tmp/apacherepo": 
    provider => git, 
    source => "[email protected]*****/testing.git", 
    identity => '/root/.ssh/id_rsa', 
    require => Package['git'], 
} 

file { '/var/www/index.file': 
    ensure => present, 
    source => '/tmp/apacherepo/index.file', 
    require => Vcsrepo['/tmp/apacherepo'] 
} 
+0

我收到此錯誤:錯誤:/Stage[main]/Webserver::Repository/File[/var/www/index.file]:無法評價:無法檢索從生產環境的源信息( s)文件:/tmp/apacherepo/index.file – 2015-04-01 13:15:04

+0

Vcsrepo是否在文件資源之前運行? – 2015-04-01 13:47:15