git - Puppet 代理无法从 Git 下载代码

标签 git window puppet puppetlabs-apache puppet-enterprise

我在 ubuntu 14.4 VM 上安装了 puppet master。 作为 Windows 8 的 Puppet 代理。

这是我的 site.pp 文件。

package { 'git' :
  ensure => present,
}

vcsrepo { "C:\\GitCode":
  ensure => present,
  provider => git,
  source => "git://<url>.git",
}

它只会从 url 下载代码并将其放入 C:\GitCode。我已经在 master 上安装了 gitvcsrepo 包。

在 Windows 上运行 Agent 时出现以下错误:

Running Puppet agent on demand ...
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for <certname>
Warning: Found multiple default providers for vcsrepo: dummy, p4; using dummy
Info: Applying configuration version '1436188748'
Error: The source parameter is required when using the Windows provider.
Error: /Stage[main]/Main/Package[git]/ensure: change from absent to present failed: The source parameter is required when using the Windows provider.
Error: /Stage[main]/Main/Vcsrepo[C:\GitCode]: Provider git is not functional on this host
Notice: Finished catalog run in 2.05 seconds
Press any key to continue . . .

最佳答案

所以这里发生了几件事。首先是 git 没有被 puppet 安装。由于代理是 Windows 框,因此您需要为其提供安装来源。所以这意味着下载 git 的安装程序 exe 并将其放在模块的文件子目录中。

package { 'git' :
  ensure => present,
  source => 'puppet:///{yourmodule}/Git-1.8.1.2-preview20130201.exe',
}

一旦在代理上正确安装了 git,vcsrepo 将使用正确的提供程序(即 - git)并 pull 您的 git 存储库。

关于git - Puppet 代理无法从 Git 下载代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31247192/

相关文章:

python - Puppet 只创建一次 virtualenv

docker - "Trailing garbage, ignoring."Docker 在 vagrant virtualbox 上的 centos 中使用 puppet 时出错

git - "git push -d remote branch"和 "git push remote :branch"有什么区别

python - 如何将 JPEG 图像插入 python Tkinter 窗口?

wpf - 为什么我的 WPF 窗口大小默认很大

node.js - 使用 NSSM 制作 node.js 服务

apache - vagrant provisining 在 Windows 上不起作用,但在 Ubuntu 上起作用

xml - 如何修复损坏的 csproj 文件?

linux - GIT - 下载最新的 tar.bz2

git - 如何在不丢失文件的情况下撤消 git 提交?