2

I want to pull some gitlab repositories using vcsrepo but for some reason it fails to execute.

vcsrepo { "/tmp/repo/update":
 ensure => present,
 provider => git,
 source => "git@gitlab:${git_url}",
 user => 'update',
}

The ssh key belongs to the user update, the source doesn't work with or without 'git@'

The error:

err: /Stage[main]//Node[xxx]/Git::Add_git[webhooks]/Vcsrepo[/tmp/webhooks/update]/ensure: change from absent to present failed: Could not set 'present on ensure: undefined method `execute' for Puppet::Util::Execution:Module at /tmp/vagrant-puppet-2/modules-0/git/manifests/init.pp:54

What did I do wrong?

David Costa
  • 628
  • 6
  • 21
Granolaboy
  • 133
  • 1
  • 1
  • 5

1 Answers1

1

If you're using the latest version of vcsrepo (https://forge.puppetlabs.com/puppetlabs/vcsrepo) in Puppet 2.7, that might be the reason why it's not working. According to the forge page, it requires Puppet 3.x.

Tim Stoop
  • 588
  • 5
  • 20
  • Then it shouldn't work with Git or SVN though, but I have no problems checking such repos out. – Granolaboy Feb 20 '15 at 16:53
  • Are these the only resources for which you use the user parameter? Could the others be using the default user (= the user as which puppet runs?). Reason I'm asking is that it looks to me the code only triggers the 'execute' when the user parameter is used. Check https://github.com/puppetlabs/puppetlabs-vcsrepo/blob/master/lib/puppet/provider/vcsrepo/git.rb line 433. – Tim Stoop Feb 20 '15 at 17:59
  • This worked for me; added the puppetlabs repository and used the latest version instead of the version that came bundled with epel. – skrilled Feb 20 '15 at 23:27
  • I use two different defined types for SVN and Gitlab, I added the 'user' variable to the Gitlab type because I want to check out the repo with a certain SSH user. Without the 'user' variable I get the following error: – Granolaboy Feb 24 '15 at 11:06
  • err: /Stage[main]//Node[xxx]/Git::Add_git[webhooks]/Vcsrepo[/tmp/webhooks/update]/ensure: change from absent to present failed: Execution of '/usr/bin/git clone gitlab://xxx/gitlab-webhooks.git /tmp/webhooks/update' returned 128: Cloning into '/tmp/webhooks/update'... fatal: Unable to find remote helper for 'gitlab' – Granolaboy Feb 24 '15 at 11:09