Foreman proxy not loading ansible plugin

**Problem: Foreman proxy not loading ansible plugin:

**Expected outcome: Foreman proxy loads ansible plugin

**Foreman and Proxy versions: 3.2.0

**Foreman and Proxy plugin versions: tfm-rubygem-smart_proxy_ansible-3.3.1-3.fm3_2.el7, tfm-rubygem-smart_proxy_remote_execution_ssh-0.5.3-1.fm3_2.el7

**Distribution and version: CentOS 7

Other relevant data:
My fresh install of foreman+katello fails upon loading the smart proxy ansible plugin. The remote-execution plugin is installed AND loaded; the frontend says ssh is a loaded plugin.

Foreman-installer fails with the following:

2022-04-08 10:30:26 [ERROR ] [configure] Proxy katello.localhost has failed to load one or more features (Ansible), check /var/log/foreman-proxy/proxy.log for configuration errors
2022-04-08 10:30:26 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[katello.localhost]/features: change from ["Dynflow", "Logs", "Pulpcore", "SSH"] to ["Ansible", "Dynflow", "Logs", "Pulpcore", "SSH"] failed: Proxy katello.localhost has failed to load one or more features (Ansible), check /var/log/foreman-proxy/proxy.log for configuration errors

When checking /var/log/foreman-proxy/proxy.log as mentioned by the installer, NO errors or warnings and no relevant logging is found. The following is an excerpt from the foreman-installer log:

2022-04-08 10:30:23 [DEBUG ] [configure] Foreman_smartproxy[katello.localhost](provider=rest_v3): Making put request to https://katello.localhost/api/v2/smart_proxies/1/refresh
2022-04-08 10:30:26 [DEBUG ] [configure] Foreman_smartproxy[katello.localhost](provider=rest_v3): Received response 200 from request to https://katello.localhost/api/v2/smart_proxies/1/refresh
2022-04-08 10:30:26 [ERROR ] [configure] Proxy katello.localhost has failed to load one or more features (Ansible), check /var/log/foreman-proxy/proxy.log for configuration errors
2022-04-08 10:30:26 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[katello.localhost]/features: change from ["Dynflow", "Logs", "Pulpcore", "SSH"] to ["Ansible", "Dynflow", "Logs", "Pulpcore", "SSH"] failed: Proxy katello.localhost has failed to load one or more features (Ansible), check /var/log/foreman-proxy/proxy.log for configuration errors
2022-04-08 10:30:26 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[katello.localhost]: Evaluated in 2.37 seconds

It fails when it tries to refresh the loaded features with a put request.

Also, when running foreman-rake db:seed, it fails with the following:

ActiveRecord::RecordInvalid: Validation failed: Remote execution features is invalid

This indicates the remote execution features are faulty, here is the content of /etc/foreman-proxy/settings.d/remote_execution_ssh.yml:

---
:enabled: https
:ssh_identity_key_file: /var/lib/foreman-proxy/ssh/id_rsa_foreman_proxy
:local_working_dir: /var/tmp
:remote_working_dir: /var/tmp
:kerberos_auth: false

# Whether to run remote execution jobs asynchronously
:mode: ssh

Another (maybe revelevant) issue I had when installing foreman and katello is the qpid-proton-c package. When installing the only version I could find was 0.37 and katello required version 0.36, but this should not be the root cause of this problem because I found a rpm of version 0.36 online and installed it so that the dependency is resolved. I also made sure all other packages are up-to-date.

Is there anyone that has an idea what is going wrong here? Thanks in advance!

Update: I think my execution order of installing the ansible proxy plugin was wrong.

I cleaned my machine and reinstalled the forman with only the --scenario katello flag. After that, I ran foreman-installer again as such:

foreman-installer --scenario katello
–enable-foreman-plugin-remote-execution
–enable-foreman-proxy-plugin-remote-execution-ssh

After enabling remote execution I ran foreman-installer once again with the following flags:

foreman-installer --scenario katello
–enable-foreman-plugin-ansible
–enable-foreman-cli-ansible
–enable-foreman-proxy-plugin-ansible

And now finally SSH remote execution over the proxy is loaded and enabled. I can’t really confirm this but it just looks like foreman didn’t properly load the remote execution proxy plugin because I was installing it at the same time as installing the ansible proxy plugin, not after each other.

1 Like