[PATCH] fixes #5561 run puppet over ssh

I created a pull request per Ohad for bug report Bug #5561: foreman-proxy run puppet over ssh doesn't work - Smart Proxy - Foreman.

Running foreman(1.4.3) and foreman-proxy (1.5.0-0) on Rhel 6.2, I found that the only way to get puppet run over ssh to work is to remove the space between -l <user> and -i <keyfile> in puppet_ssh.rb.
However, I am unable to test this on any other OS at this time.

@@ -6,10 +6,10 @@ def run

     cmd = []

     cmd.push(which(&#39;sudo&#39;)) if SETTINGS.puppetssh_sudo

     cmd.push(which(&#39;ssh&#39;))
  •  cmd.push(&quot;-l #{SETTINGS.puppetssh_user}&quot;) if SETTINGS.puppetssh_user
    
  •  cmd.push(&quot;-l#{SETTINGS.puppetssh_user}&quot;) if SETTINGS.puppetssh_user
    
     if (file = SETTINGS.puppetssh_keyfile)
    
       if File.exists?(file)
    
  •      cmd.push(&quot;-i #{file}&quot;)
    
  •      cmd.push(&quot;-i#{file}&quot;)
    
       else
    
         logger.warn(&quot;Unable to access SSH private key:#{file}, ignoring...&quot;)
    
       end

Thanks, I commented on the PR.

LZ

··· On Mon, May 05, 2014 at 10:45:19AM -0700, Alyssa H wrote: > > > I created a pull request per Ohad for bug report http://projects.theforeman.org/issues/5561. > > Running foreman(1.4.3) and foreman-proxy (1.5.0-0) on Rhel 6.2, I found that the only way to get puppet run over ssh to work is to remove the space between -l and -i in puppet_ssh.rb. > However, I am unable to test this on any other OS at this time. > > @@ -6,10 +6,10 @@ def run > > cmd = [] > > cmd.push(which('sudo')) if SETTINGS.puppetssh_sudo > > cmd.push(which('ssh')) > > - cmd.push("-l #{SETTINGS.puppetssh_user}") if SETTINGS.puppetssh_user > > + cmd.push("-l#{SETTINGS.puppetssh_user}") if SETTINGS.puppetssh_user > > if (file = SETTINGS.puppetssh_keyfile) > > if File.exists?(file) > > - cmd.push("-i #{file}") > > + cmd.push("-i#{file}") > > else > > logger.warn("Unable to access SSH private key:#{file}, ignoring...") > > end > > -- > You received this message because you are subscribed to the Google Groups "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman