Bug 1482504 - network.hostname-override defaults to "localhost" if no fqdn set
Summary: network.hostname-override defaults to "localhost" if no fqdn set
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installer
Version: 6.2.11
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Sanket Jagtap
Depends On:
TreeView+ depends on / blocked
Reported: 2017-08-17 12:39 UTC by James Slagle
Modified: 2021-06-10 12:49 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-02-21 16:54:37 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20642 0 Normal Closed network.hostname-override defaults to "localhost" if no fqdn set 2020-06-11 20:42:18 UTC
Foreman Issue Tracker 20816 0 Normal Closed Don't consider localhost as valid host name when parsing rhsm facts 2020-06-11 20:42:18 UTC

Description James Slagle 2017-08-17 12:39:43 UTC
When you install the generated katello-ca-consumer rpm from a satellite server, it sets the network.hostname-override to result of the "hostname -f" command.

If no fqdn or domain name is actually set on the system, then that command just returns "localhost".

When the system  is actually registered to satellite the host will be called localhost instead of the actual hostname (or short hostname if one is set). I actually have a set hostname on the system which could be used instead if not for the override fact being set:

[root@centos7 ~]# jq . /var/lib/rhsm/facts/facts.json | grep hostname
  "network.hostname": "centos7.localdomain",
  "network.hostname-override": "localhost",

Also, if you have 2 different systems that no fqdn set and you register them both to the same satellite, than only a single host is created in satellite called "localhost" and one registration just overwrites the other one.

Would it be possible to default to "hostname" if "hostname -f" returns localhost?

Should hosts created in satellite be overwriting one another if they only share the value of "localhost" for their fqdn?

Comment 1 Ivan Necas 2017-08-18 12:37:55 UTC
The functionality to match the host against the hostname if it already exists is there on purpose, to make it possible to match provisioned host with the one registered with subscription manager.

Changing the component to installer, since that's where the katello-ca-consumer rpm is generated.

Comment 2 Ivan Necas 2017-08-18 12:50:27 UTC
Created redmine issue http://projects.theforeman.org/issues/20642 from this bug

Comment 3 Satellite Program 2017-08-23 22:02:01 UTC
Upstream bug assigned to inecas@redhat.com

Comment 4 Satellite Program 2017-08-23 22:02:04 UTC
Upstream bug assigned to inecas@redhat.com

Comment 6 Satellite Program 2017-08-30 20:01:56 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20642 has been resolved.

Comment 7 Ivan Necas 2017-09-07 06:04:52 UTC
Putting to assigned, as there was also fix on server side to handle the situation better

Comment 8 Satellite Program 2017-09-07 08:20:38 UTC
Upstream bug assigned to jsherril@redhat.com

Comment 9 Satellite Program 2017-09-07 08:20:41 UTC
Upstream bug assigned to jsherril@redhat.com

Comment 10 Satellite Program 2017-09-07 14:20:39 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20816 has been resolved.

Comment 11 Sanket Jagtap 2017-12-11 16:31:46 UTC
Bug : Satellite 6.3.0 snap28

[root@bkr-hv01-guest27 ~]# hostname
[root@bkr-hv01-guest27 ~]# hostname -f

nslookup 10.19.XX.XX
Address:	#53

Non-authoritative answer:
name = bkr-hv01-guest27.com.

 subscription-manager register --org="Default_Organization" --activationkey="ak-rhel-7"
The system has been registered with ID: 8dc7d3ac-4d2b-4656-9d49-60dabcad49d7 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@bkr-hv01-guest27 ~]# subscription-manager facts --list | grep hostname
network.hostname: localhost
network.hostname-override: bkr-hv01-guest27.com

ID | NAME                                                   | OPERATING SYSTEM | HOST GROUP              | IP           | MAC               | CONTENT VIEW | LIFECYCLE ENVIRONMENT
6  | bkr-hv01-guest27.com           | RedHat 7.4       |                         | 10.19.XXXXX | 00:16:3eXXXXXX | RHEL 7 CV    | DEV

Comment 12 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336

Note You need to log in before you can comment on or make changes to this bug.