Hi, I’m having trouble running the remote execution plugin. For the configuration I have used this command: sudo foreman-installer --enable-foreman-proxy --enable-foreman-plugin-remote-execution --enable-foreman-proxy-plugin-remote-execution-script --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible --enable-foreman-plugin-setup
I have verified that in the created hosts there is a public key of the foreman-proxy and I have added the key of the Master Node in which foreman is running.
When I try to do a simple command to check that it works, this is the output:
** 1: Error initializing command: RuntimeError - Could not establish connection to remote host using any available authentication method, tried password, publickey
2: Exit status: EXCEPTION**
The Schedule Remote Job has been tried to be done by user and by rsa key, but none with success.
Expected outcome:
The remote execution plugin works Foreman and Proxy versions:
Foreman → 3.4.1 Foreman and Proxy plugin versions:
foreman_remote_execution → 8.0.0 Distribution and version:
Rocky Linux 8.7 Other relevant data:
Also from a Master Node terminal I can connect via ssh without any problem. With the user foreman-proxy it simply asks me for the password.
Almost surely, the keys that are actually used are not in the right places. That’s all the error says and all that we can guess from what you told us. If you bump log level to debug in /etc/foreman-proxy/settings.yaml you should get the exact commands that foreman-proxy is trying to execute in /var/log/foream-proxy/proxy.log. You can take those and follow along
Thanks for the reply. This command works for me to access via ssh from a terminal, but I still have the problem that if I try to do a Schedule Remote Job from the graphical interface of foreman I get the error:
1: Error initializing command: RuntimeError - Could not establish connection to remote host using any available authentication method, tried publickey
2: Exit status: EXCEPTION
Also, when I run the command " sudo -u foreman-proxy ssh -i /var/lib/foreman-proxy/ssh/id_rsa_foreman_proxy root@192.168.0.101 " I have to do it with IP, if I try it with fqdn it doesn’t find the client . Example: " sudo -u foreman-proxy ssh -i /var/lib/foreman-proxy/ssh/id_rsa_foreman_proxy root@node1.dec.udc.es ", the error is: ssh: Could not resolve hostname node1.dec.udc.es: Name or service not known
I don’t know if this can affect the ssh error.
That is most likely the source of your problem. You might have DNS issues. If DNS is generally not working in your environment, you can change Foreman’s behaviour to connect via IP. In the WebUI, got to Administer → Settings → Remote execution, there change “connect by IP” from “no” to “yes”.
If DNS should be working in your environment, you will have to take a look into why Foreman cannot resolve the (or maybe any?) hostnames via DNS.