Puppet代理无法从Git下载代码

3
我在Ubuntu 14.4虚拟机上设置了Puppet Master。Windows 8是Puppet Agent。
以下是我的site.pp文件。
package { 'git' :
  ensure => present,
}

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

它将从url下载代码并将其放入C:\GitCode。我已在主机上安装了gitvcsrepo软件包。

在Windows上运行代理时,我收到了以下错误:

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 . . .

你使用的VCS repo模块版本是什么?因为我在Windows 8测试实验室中尝试了这段代码,并且使用最新版本的VCSrepo模块可以正常工作。 - Peter Souter
谢谢你的回复,我正在使用vcsrepo 1.3.0。 - pm86
1个回答

2

这里有几个问题需要解决。首先,Puppet没有安装git。由于代理是Windows操作系统,您需要提供一个可安装的源。因此,您需要下载git的安装程序exe并将其放在模块的文件子目录中。

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

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


这是否意味着我们需要在Windows代理上安装Git,然后使用git提供程序下载存储库?对于行source => 'puppet:///{yourmodule}/Git-1.8.1.2-preview20130201.exe',git可执行文件将位于主机上还是应该放在共享位置上。 - pm86
1
是的,Git-1.8.1.2-preview20130201.exe将会在主节点上。您的site.pp将被运行并尝试将该文件从主节点传输到代理节点,并在代理节点上安装Git。https://docs.puppetlabs.com/guides/file_serving.html - TwoDrinkTech

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接