Foreman-proxy-certs-generate error with katello 3.18.1

I have justed updated from 3.17.2 to 3.18.1. Now on my master server I cannot run foreman-proxy-certs-generate anymore:

[root@foreman ~]# foreman-proxy-certs-generate --foreman-proxy-fqdn "foreman-proxy.example.com"         --certs-tar  "~/foreman-proxy.example.com-certs.tar"         --server-cert "/root/foreman-proxy.crt"         --server-key "/root/foreman-proxy.key"         --server-ca-cert "/etc/pki/tls/certs/example-bundle-g2.crt"         --certs-update-all
Traceback (most recent call last):
	13: from /sbin/foreman-proxy-certs-generate:31:in `<main>'
	12: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/kafo_configure.rb:50:in `run'
	11: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
	10: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/kafo_configure.rb:169:in `run'
	 9: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
	 8: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/kafo_configure.rb:199:in `execute'
	 7: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/hooking.rb:51:in `execute'
	 6: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/hooking.rb:51:in `each'
	 5: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/hooking.rb:53:in `block in execute'
	 4: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/hook_context.rb:19:in `execute'
	 3: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/hook_context.rb:19:in `instance_eval'
	 2: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/hooking.rb:35:in `block (4 levels) in load'
	 1: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.1.2/lib/kafo/hooking.rb:35:in `instance_eval'
/usr/share/foreman-installer/katello-certs/hooks/pre_commit/20-certs_update.rb:17:in `block (4 levels) in load': undefined method `execute!' for #<Kafo::HookContext:0x0000000002d94278> (NoMethodError)

Looks like you found a bug we introduced with some re-arranging of code in the installer that only manifests when supplying custom certificates to foreman-proxy-certs-generate. You can work around this:

ln -s /usr/share/foreman-installer/hooks/boot/01-kafo-hook-extensions.rb /usr/share/foreman-installer/katello-certs/hooks/boot/01-kafo-hook-extensions.rb

I’ve filed an issue to fix this officially and marked it for inclusion in the next 2.3 release: Bug #31611: foreman-proxy-certs-generate fails with custom certificates - Installer - Foreman