Problem: Foreman server added itself also as localhost host.
Expected outcome: Only one foreman host server.
Foreman and Proxy versions: 1.22.1
I’ve recently installed the foreman server (following the quick start instructions on the manual) and configured it so far (ldap, vmware plugin etc.).
But everytime I visit the dashboard I encounter the listing of two foreman host server. One with its correct fqdn and the same server with the name localhost.localdomain.
When I try to remove the localhost server it adds itself back after 30mins (puppet cycle).
I’ve checked the hostname / hosts file and everything seems correct in there.
would you check the Puppet certificate name on your Foreman host? That sounds like it is automatically imported from Puppet. In your Puppet SSL dir (usually either /var/lib/puppet/ssl or /etc/puppetlabs/puppet/ssl), you should have a certs folder containing the hosts own Puppet certificate (+ maybe others on the master). Have a look at the Foreman hosts own certificate with openssl and check the Subject. Maybe that has localhost set.
sounds like you have not had your hostname set up correctly when the installer generated the certificates.
I do not know if regenerating the certificates with the correct name is an easy task though, once Foreman is set up and running.
Reinstalling sounds like overkill. If it’s just the Puppet CA then you can remove /etc/puppetlabs/puppet/ssl and restart the the Puppetserver process followed by restarting Puppet as well. If Foreman uses the certs as well (which is default) then you should also restart Apache and Foreman-Proxy.