Project

General

Profile

Actions

Bug #5561

closed

foreman-proxy run puppet over ssh doesn't work

Added by Anonymous over 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Puppet
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

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. Otherwise, the remote system shows this in the logs (X's added). Note the extra whitespace appearing before foreman-proxy user.

May  2 14:06:04 XXXXX sshd[2430]: Invalid user  foreman-proxy from X.X.X.X
May  2 14:06:04 XXXXX sshd[2431]: input_userauth_request: invalid user  foreman-proxy
May  2 14:06:04 XXXXX sshd[2430]: Failed none for invalid user  foreman-proxy from X.X.X.X port 34970 ssh2
May  2 14:06:04 XXXXX sshd[2430]: Failed password for invalid user  foreman-proxy from X.X.X.X port 34970 ssh2
May  2 14:06:04 XXXXX sshd[2430]: Failed password for invalid user  foreman-proxy from X.X.X.X port 34970 ssh2
May  2 14:06:04 XXXXX sshd[2431]: Connection closed by X.X.X.X

Related settings look like:

:puppet: true
:puppet_provider: puppetssh
:puppetssh_sudo: false
:puppetssh_command: /usr/local/bin/puppet_with_sudo.sh
:puppetssh_user: foreman-proxy
:puppetssh_keyfile: /etc/foreman-proxy/ssh/id_rsa

If I change the code to the following, and restart, it runs just fine.

--- foreman-proxy/lib/proxy/puppet/puppet_ssh.rb.orig    2014-05-02 14:06:33.010472500 -0500
+++ foreman-proxy/lib/proxy/puppet/puppet_ssh.rb    2014-05-02 14:06:21.626366466 -0500
@@ -6,10 +6,10 @@
       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

Actions #1

Updated by Ohad Levy over 10 years ago

would you mind sending a PR as well?

thanks!

Actions #2

Updated by Anonymous over 10 years ago

I'll be happy to provide more information, but what's a PR?

Actions #3

Updated by Marek Hulán over 10 years ago

PR stands for Pull Request on github. For more information how to do that, see tutorial on our wiki

Actions #4

Updated by Anonymous over 10 years ago

Thanks, PR created.

Actions #5

Updated by Marek Hulán over 10 years ago

  • Category set to Puppet
  • Status changed from New to Ready For Testing

Just for the reference, PR is here https://github.com/theforeman/smart-proxy/pull/154

Actions #6

Updated by Dominic Cleal over 10 years ago

  • Target version set to 1.8.3
  • Translation missing: en.field_release set to 4
Actions #7

Updated by Anonymous over 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #8

Updated by Bryan Kearney over 10 years ago

  • Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1103935
Actions

Also available in: Atom PDF