gitwindowpuppetpuppetlabs-apachepuppet-enterprise

Puppet agent not able download code from Git


I have puppet master setup on ubuntu 14.4 VM. Puppet agent as Windows 8.

here is my site.pp file.

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

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

It will simply download code from url and put it into C:\GitCode. I have installed git and vcsrepo packages on master.

While running Agent on windows I got the following error:

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

Solution

  • So there are a couple of things going on here. The first is that git is not being installed by puppet. You need to provide a source for it to install from since the agent is a windows box. So this means download the installer exe for git and put it in your files subdirectory of your module.

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

    Once it properly has git installed on the agent then vcsrepo will use the correct provider (i.e. - git) and pull your git repo.