Foreman server added also as localhost host server

Problem: Foreman server added itself also as localhost host.

Expected outcome: Only one foreman host server.

Foreman and Proxy versions: 1.22.1

Hello.

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.

Thank you for your help.

Hi,

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.

Hi areyus.

I’ve checked the cert folder under /etc/puppetlabs/puppet/ssl and in there I found a ca.pem file and the foreman.localdomain.pem file

I also checked the foreman ssl certificate and it contains following information:

  • Issuer: CN = Puppet CA: foreman.localdomain
  • Subject: CN = foreman.localdomain
  • subject Alternative Name: DNS:puppet, DNS:foreman.localdomain

Hi,

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.

I followed exactly the procedure in the quick start guide and didn’t give any options to the installer. I guess I have to reinstall Foreman completely from the scratch. :frowning:

Thanks @areyus!

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.

I had a merely fresh installation so to re-do it is not that big deal. I will try it your way if it happens again in the future. Thank you @ekohl.