Problem installing ansible plugin

Problem:
Istalled Foreman 3.4.1 using foreman-installer. All good. Need to install ansible plugin. Installed rubygem-foreman_ansible package from foreman-plugins repo - version 9.0.1-1.fm3_4.el8. After that foreman would not start any more. Looks like version of the plugin does not work with this setup. Removing plugin solved startup issue but I need this plugin for ansible integration. Does anybody know what version of plugin would work in this setup and where can I get it?
Expected outcome:

Foreman and Proxy versions:
Foreman 3.4.1
Foreman and Proxy plugin versions:
foreman_ansible 9.0.1
Distribution and version:
Rocky 8.7
Other relevant data:
I see following error in /var/log/nessages:
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in require’: cannot load such file – rails/commands (LoadError)`

You should install the plug-in following the docs: Configuring Hosts Using Ansible

1 Like

Thanks! I just ran foreman-installer command from the link you provided. I removed the rpm package from the system before running this command. There are some errors at the end of installation -

2022-12-29 15:29:15 [ERROR ] [configure] Error making PUT request to https://it-foreman.NNN.edu/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on it-foreman.NNN.edu for detailed information
2022-12-29 15:29:15 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[it-foreman.NNN.edu]/features: change from ["Logs", "Puppet", "Puppet CA"] to ["Ansible", "Dynflow", "Logs", "Puppet", "Puppet CA"] failed: Error making PUT request to https://it-foreman.NNN.edu/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on it-foreman.NNN.edu for detailed information
2022-12-29 15:29:15 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[it-foreman.NNN.edu]: Failed to call refresh: Error making PUT request to https://it-foreman.cshl.edu/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on it-foreman.NNN.edu for detailed information
2022-12-29 15:29:15 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[it-foreman.NNN.edu]: Error making PUT request to https://it-foreman.cshl.edu/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on it-foreman.NNN.edu for detailed information
2022-12-29 15:29:15 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-it-foreman.NNN.edu]: Could not evaluate: Error making GET request to Foreman at https://it-foreman.cshl.edu/api/v2/hosts: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on it-foreman.NNN.edu for detailed information
2022-12-29 15:29:17 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.

  The full log is at /var/log/foreman-installer/foreman.log

Foreman log shows this:

2022-12-29T15:29:15 [I|app|947437f1]   Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 3.7ms | Allocations: 5346)
2022-12-29T15:29:15 [I|app|947437f1]   Rendered layout api/v2/layouts/error_layout.json.erb (Duration: 6.6ms | Allocations: 10676)
2022-12-29T15:29:15 [I|app|947437f1] Completed 500 Internal Server Error in 146ms (Views: 7.6ms | ActiveRecord: 13.6ms | Allocations: 33718)
2022-12-29T15:30:05 [I|app|] Rails cache backend: File
2022-12-29T15:30:06 [W|app|] You are trying to replace import_subnets from . Adding allowed actions from plugin permissions to the existing one.
2022-12-29T15:30:07 [W|app|] Setting remote_execution_workers_pool_size has no definition, please define it before using
2022-12-29T15:30:07 [W|app|] You are trying to replace view_hosts from foreman_ansible. Adding allowed actions from plugin permissions to the existing one.
2022-12-29T15:30:07 [W|app|] You are trying to replace view_hostgroups from foreman_ansible. Adding allowed actions from plugin permissions to the existing one.
2022-12-29T15:30:07 [W|app|] You are trying to replace edit_hosts from foreman_ansible. Adding allowed actions from plugin permissions to the existing one.
2022-12-29T15:30:07 [W|app|] You are trying to replace edit_hostgroups from foreman_ansible. Adding allowed actions from plugin permissions to the existing one.
2022-12-29T15:30:07 [W|app|] Creating scope :completer_scope. Overwriting existing method Location.completer_scope.
2022-12-29T15:30:07 [W|app|] Creating scope :completer_scope. Overwriting existing method Organization.completer_scope.
2022-12-29T15:30:09 [W|app|] Scoped order is ignored, it's forced to be batch order.

This is definitely a progress, I will see If I need to do more configuration steps!

1 Like