Running an Ansible command via the “Run Command - Ansible Default” template does not work as expected.
I’m also a FreeIPA user. I have the foreman-proxy public key associated with the correct user at FreeIPA and I’ve cleared all sssd cache’s etc. The FreeIPA user in question has full sudo privileges via FreeIPA sudo rules etc,
I know that Foreman RemoteExecution in general works because I can run a “Run Command - SSH Default” template type job and that does what I expect. Meaning, the settings under Administer > Settings > RemoteExecution, EffectiveUser, EffectiveUserMethod, SSH User all do what I expect.
I have enabled verbose logging for sshd on the client machine
And when I do a “Run Command - SSH Default”, I see the connection come in as user “jrichard”, see it check the public key, say “okay” then the sudo and success.
But if I try this via the “Run Command - Ansible Default”, I see the Foreman trying to connect as root seemingly no matter what I try… set ansible_user host param, or global parm, set the effective user to “root” in the template definition etc.
I guess my problem is related to or is exactly:
But as far as I can tell I have the latest versions of Forman, and Ansible, foreman_ansible etc.
run an Ansible command and have the SSH user + effective user settings cause Ansible to connect via ssh as the “SSH user” and then sudo.
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Other relevant data:
Maybe I’m just doing it wrong
Can someone tell me what settings I need to apply to have Foreman run an Ansible command as user “x” and do as via sudo"?