Overriding the system hostname when registering into Red Hat Satellite

Sometimes you need to ensure that a system registered into Satellite has a specific hostname, because the current one is unacceptable for a number of reasons (it might collide with another one, etc).

The Satellite documentations points to the fact that you can override the name by configuring a setting in the subscription-manager facts, however this does not seem to work in newer (6.12+) versions of Red Hat Satellite.

In the latest testing I did, this way ensures the system is registered with the requested hostname in Satellite.

  • Ensure the old host and content hosts are deleted from Satellite (if required).
  • Add the requested hostname in /etc/hosts of the system, bound to one of its IPs. It does not matter if it's not the first entry associated to the IP.
  • Ensure that /etc/rhsm/facts/katello.facts has this settings:

    {
    "network.fqdn":"new-name.example.com",
    "network.hostname":"new-name.example.com",
    "network.hostname-override":"new-name.example.com"
    }
    
  • Register the system again with subscription-manager, eg:

    subscription-manager register --org="ORGANIZATION" --activationkey="ACTIVATIONKEY" --force --name=new-name.example.com
    

In addition to this, it seems that simply setting the network.hostname-override parameter does not longer work by default. Satellite can be configured to obey this parameter, but the rest of the configuration is still required.

Some relevant documents:

  • https://access.redhat.com/solutions/3166211 - Registered content host appears with a different hostname in Red Hat Satellite WebUI.
  • https://access.redhat.com/solutions/3732221 - network.hostname-override is not overriding the hostname of server for registration

Happy hacking!