Remote execution ignoring remote_execution_ssh_user parameter after update


#1

Problem:
Remote execution always uses root, ignoring remote_execution_ssh_user param after updating to 1.22
Worked fine before update ( running 1.21.3 ) - update went fine except for remote execution no longer working.

Error initializing command: Net::SSH::AuthenticationFailed - Authentication failed for user root@host.example.com

Expected outcome:
Remote execution should ssh to the machine using the user specified with the remote_execution_ssh_user parameter, as it did before, and not root (default).
I’ve tested using ssh manually using the correct user@host.example.com through command line and that works fine.

Foreman and Proxy versions:
Foreman / Proxy: 1.22.0
Katello: 1.12

Foreman and Proxy plugin versions:
As reported by Smart-proxy page:
Ansible: 2.1.2
Dynflow: 0.2.2
HTTPBoot: 1.22.0
Pulp: 1.4.1
Pulp server version: 2.19.1
Workers: 8
SSH: 0.2.1
TFTP: 1.22.0
TFTP server: false
Templates: 1.22.0

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

Ansible tries to connect as root instead of remote_execution_ssh_user
#2

After more testing this seems to be ansible related, not remote-execution!
Fails when using Ansible job templates ( Command: /bin/true in this case ) but if i change to the remote_executions standard Command template, it seems to work. my bad tehre.

Still would like this solved for me for the Ansible jobs - Do i need to set the SSH User somewhere else aswell now for Ansible or is it still using the Remote executions parameter?


#3

I think this might be related to Bug #25361: Unable to disable ansible_become_user - Ansible - Foreman. We were using ansible_become_user on connection, which caused that all become_user inside playbook were being ignored. Now it can be disabled when remote_execution_effective_user is blank.


#4

I am sorry but I could not reproduce :anguished:. Correct user was always present for ssh when I tried both remote_execution_ssh_user host param and a changed value directly in settings.

New foreman_remote_execution and foreman_remote_execution_core gems landed in 1.22 repo today, I would recommend to update and restart httpd, foreman-proxy, dynflowd and smart_proxy_dynflow_core.


#5

Is this perhaps also fixed via remote_execution 1.8? I have no productive environment access at the moment but on my systems it at least seems so in a quick test.

@birkirf: Can you update remote_execution and have a look?


#6

Updated this morning and it works now.
Would love to be able to use a password protected ssh-key with ansible though, but that’s a totally different issue. :slight_smile: