我在 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 上安装了 git
和 vcsrepo
包。
在 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/