Merge pull request #65 from rkhatibi/master
authorAaron Stone <aaron@serendipity.cx>
Sat, 13 Jul 2013 22:04:47 +0000 (15:04 -0700)
committerAaron Stone <aaron@serendipity.cx>
Sat, 13 Jul 2013 22:04:47 +0000 (15:04 -0700)
Add timeout to ssh connections

lib/puppet/provider/vcsrepo/git.rb

index 6f979cb..76fa315 100644 (file)
@@ -293,7 +293,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
     if @resource.value(:identity)
       Tempfile.open('git-helper') do |f|
         f.puts '#!/bin/sh'
-        f.puts "exec ssh -oStrictHostKeyChecking=no -oPasswordAuthentication=no -oKbdInteractiveAuthentication=no -oChallengeResponseAuthentication=no -i #{@resource.value(:identity)} $*"
+        f.puts "exec ssh -oStrictHostKeyChecking=no -oPasswordAuthentication=no -oKbdInteractiveAuthentication=no -oChallengeResponseAuthentication=no -oConnectTimeout=120 -i #{@resource.value(:identity)} $*"
         f.close
 
         FileUtils.chmod(0755, f.path)