How to uninstall IPAM plugin?

Problem:

Our Foreman/Katello installation is using the external IPAM module with phpIPAM. Lately we hae had some trouble with it so we want to remove it from the installation.

Since the ruby gem smart_proxy_ipam is not packaged in the Foreman repositories, we uses “gem install” to install it. Naively, we tried to uninstall is by running “gem uninstall smart_proxy_ipam -v 0.1.4”, but this results in the foreman-proxy SystemD service now failing:

Oct 22 13:07:44 hostname systemd[1]: Starting Foreman Proxy...
Oct 22 13:07:45 hostname smart-proxy[93760]: /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/output.rb:13:in `strict_err': Gem loading error: cannot load such file >
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:46:in `rescue in block in system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:39:in `block in system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/foreman-proxy/lib/bundler_helper.rb:23:in `require_groups'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:30:in `<top (required)>'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
Oct 22 13:07:45 hostname smart-proxy[93760]: /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- smart_proxy_ipam (LoadError)
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:41:in `block in system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/foreman-proxy/lib/bundler_helper.rb:23:in `require_groups'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/foreman-proxy/lib/smart_proxy_main.rb:30:in `<top (required)>'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
Oct 22 13:07:45 hostname smart-proxy[93760]:         from /usr/share/foreman-proxy/bin/smart-proxy:5:in `<main>'
Oct 22 13:07:45 hostname systemd[1]: foreman-proxy.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 13:07:45 hostname systemd[1]: foreman-proxy.service: Failed with result 'exit-code'.

Is there some way of telling foreman-installer to deconfigure the plugin? I couldn’t find any related option in the --help output and the IPAM plugin is not listed in the interactive foreman-installer either.

Expected outcome:

Foreman-proxy no longer tries to pull in plugin code at startup.

Foreman and Proxy versions:

foreman-3.10.1-1.el8.noarch
foreman-proxy-3.10.1-1.el8.noarch

Foreman and Proxy plugin versions:

smart_proxy_ipam 0.1.4

Distribution and version:

CentOS 8 Stream

Other relevant data:

Do you have any files in /usr/share/foreman-proxy/bundler.d/ that still refer to the smart_proxy_ipam gem?

Yes, there was a line in /usr/share/foreman-proxy/bundler.d/Gemfile.local.rb referencing hte IPAM plugin. After removing the line the SystemD unit foreman-proxy.service was successfully restarted.

After refreshing the feature list of the server in the Smart Proxies view, the IPAM feature has disappeared. We still had to manually remove the external IPAM entries from various subnet objects, but it looks like we are good now.

Thank you.

1 Like