Remote execution ignoring remote_execution_ssh_user parameter after update

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

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 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.)


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?

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.

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.

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?

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:

1 Like

I don’t know I’m doing the right thing by bumping this old topic, but it’s the only thing relevant that I can find after searching.

I am experiencing the same issue with ansible plays not setting the user, it keeps defaulting to root@

Foreman/Proxy -
2.10 on Ubuntu 18.04, clean install.
Plugins -
foreman_ansible 5.1.1
foreman_remote_execution 3.3.4

I’ve tried setting/unsetting

Regardless, I keep getting

in the proxy log.
Has this bug resurfaced or it simply that I have an incorrect combination of settings?
Is there anything that needs to be set or unset in the ansible.cfg?

Any help would be greatly appreciated