2013-04-10 125 views
0

試圖從puppet使用vcsrepo模塊爲devstack安裝GIT存儲庫。使用https://github.com/ ...但是在防火牆後面。有一個代理服務器可用於通過http,https和FTP訪問Internet。防火牆後面的木偶vcsrepo?

當使用這個模塊時,有沒有一種方法可以包含代理?我在vcsrepo中找不到任何似乎可行的東西。如果需要,願意調整(破解)模塊。

回答

1

你可以看看在模塊vcsrepo/lib中/傀儡/供應商/ vcsrepo/git.rb

接近文件的底部:

def git_with_identity(*args) 

添加以下剛下上面的行:

if @resource.value(:http_proxy) 
    ENV['http_proxy'] = @resource.value(:http_proxy) 
    ENV['https_proxy'] = @resource.value(:http_proxy) 
end 

下一頁編輯vcsrepo/lib中/傀儡/類型/ vcsrepo.rb - 最後年底前加:

newparam :http_proxy do 
desc "http proxy to use to communicate with the outside world" 
end 

現在在你的傀儡表現可以添加HTTP_PROXY VAR:

vcsrepo { '/var/www/blash': 
      ensure => present, 
      provider => git, 
      http_proxy => 'http://prxy.local:8080', 
      require => Class['git-core'], 
      source => 'http://github.com/blah/blah.git'; 
    } 
1

我能夠解決此,而無需修改代碼vcsrepo。 相反,我在root的主目錄中創建了一個.gitconfig文件,它指定了https/http協議的代理信息。