Ansible tries to connect as root instead of remote_execution_ssh_user

The Ansible plugin ignore the setting for remote_execution_ssh_user (and ansible_user) when trying to connect to the host.

Expected outcome:
The plugin allows to use a different user.

Foreman and Proxy versions:

Foreman and Proxy plugin versions:
Ansible plugin 3.0.2
Katello 3.12.0

Other relevant data:
Error output is: Error initializing command: Net::SSH::AuthenticationFailed - Authentication failed for user root@XXX

Settings for Remote Execution:

  • Effective user: root
  • SSH User: ec2-user

I also tried setting ansible_user and remote_execution_ssh_user as global and host parameter.

I also found bug report Bug #26722: ansible_user is not used when running ansible roles - Ansible - Foreman

Perhaps @Ondrej_Prazak can help here?


I think this is the same issue as Remote execution ignoring remote_execution_ssh_user parameter after update.