Cannot delete an host for which puppet does not have a certificate
While playing with provisioning (libvirt) guest hosts, I've been hit by a bug that prevent me from deleting a host using the Foreman GUI.
The host is created using the Foreman web interface. It's a libvirt guest, using a custom PXELinux provisioning template.
When trying to delete it before it has registered to the puppet master, I have the following error message:
Failed to remove test3.vm.logilab.fr's puppet certificate: Failed to remove certificate(s) for
test3.vm.logilab.fr: SSL/CA unavailable on this machineFailed to generate PXELinux
template: Missing host to link to! Please provide :host parameter or set
default_url_options[:host]Failed to perform rollback on DHCP Settings for
test3.vm.logilab.fr - undefined method `create' for nil:NilClass
#2 Updated by David Douard over 8 years ago
The problem persist with latest nighty build deb package (0.5-~nightlybuild1322446320).
As a quick and dirty fix, I've just made the "failure" statement in the delCertificate (app/models/orchestration/puppetca.rb) a "logger.info". This allowed me to remove the host from the web UI.
#3 Updated by Joshua Hoblitt almost 8 years ago
This issue is still present in foreman-1.0.1-1.el6.noarch.
Failed to remove test.xxx's puppet certificate: 406 Not Acceptable Failed to generate PXELinux template: Missing host to link to! Please provide :host parameter or set default_url_options[:host]
My crude workaround is to run `puppetca generate test.xxx` and then delete the host from the foreman UI.
#5 Updated by Joshua Hoblitt over 7 years ago
That is indeed my setup
[root@ctrl ~]# rpm -qa | egrep 'foreman|puppet' puppet-2.7.19-1.el6.noarch foreman-1.0.1-1.el6.noarch foreman-release-1.0.1-1.el6.noarch foreman-proxy-1.0.0-3.el6.noarch foreman-libvirt-1.0.1-1.el6.noarch foreman-cli-1.0.1-1.el6.noarch foreman-ec2-1.0.1-1.el6.noarch foreman-console-1.0.1-1.el6.noarch puppetlabs-release-6-6.noarch puppet-server-2.7.19-1.el6.noarch rubygem-foremancli-1.0-1.el6.noarch