Actions
Bug #5561
closedforeman-proxy run puppet over ssh doesn't work
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