rhel-registration script broken with satellite 6.2.5+

Bug #1711435 reported by James Slagle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
James Slagle

Bug Description

When katello-ca-consumer is installed in the rhel-registration script, a %post script (/bin/katello-rhsm-consumer) runs "hostname -f" and sets a hostname override fact to the result.

The issue is if there is no fqdn configured and that command returns localhost, then the system will be registered in satellite with localhost as the name instead of the hostname (or shortname).

Multiple systems with a fqdn of localhost also end up just overwriting each other in the satellite.

See
https://bugzilla.redhat.com/show_bug.cgi?id=1412352
https://bugzilla.redhat.com/show_bug.cgi?id=1482504

We'd like need to move the configuration of /etc/hosts to happen earlier than the RHEL registration script to fix this properly. That can be problematic since moving the RHEL registration resources would result in systems getting removed from satellite if they are already registered until everyone upgrades to have:

https://review.openstack.org/#/c/492970/

Changed in tripleo:
status: New → In Progress
importance: Undecided → High
assignee: nobody → James Slagle (james-slagle)
milestone: none → queens-1
tags: added: pike-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/494669

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/494669
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=d59ba51a1365e897b072c19c40346f0237f62c8b
Submitter: Jenkins
Branch: master

commit d59ba51a1365e897b072c19c40346f0237f62c8b
Author: James Slagle <email address hidden>
Date: Thu Aug 17 14:27:30 2017 -0400

    Workaround for RHEL registration as "localhost"

    Workaround systems getting registered as "localhost" during
    RHEL registration if they don't have a fqdn set by first
    rm'ing the /etc/rhsm/facts directory. When the directory does not
    exist, the katello-rshm-consumer which runs when installing
    the katello-ca-consumer will not set the hostname.override fact to
    "localhost".

    Change-Id: Ia29aa9c775f715f9745bb7e1e4022cc395a7d092
    Partial-Bug: #1711435

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/495451

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/495453

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/newton)

Reviewed: https://review.openstack.org/495453
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=a33d7dde36e7a419cd1aef9ddb72b05bdbc77f98
Submitter: Jenkins
Branch: stable/newton

commit a33d7dde36e7a419cd1aef9ddb72b05bdbc77f98
Author: James Slagle <email address hidden>
Date: Thu Aug 17 14:27:30 2017 -0400

    Workaround for RHEL registration as "localhost"

    Workaround systems getting registered as "localhost" during
    RHEL registration if they don't have a fqdn set by first
    rm'ing the /etc/rhsm/facts directory. When the directory does not
    exist, the katello-rshm-consumer which runs when installing
    the katello-ca-consumer will not set the hostname.override fact to
    "localhost".

    Change-Id: Ia29aa9c775f715f9745bb7e1e4022cc395a7d092
    Partial-Bug: #1711435
    (cherry picked from commit d59ba51a1365e897b072c19c40346f0237f62c8b)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (stable/ocata)

Change abandoned by Emilien Macchi (<email address hidden>) on branch: stable/ocata
Review: https://review.openstack.org/495451
Reason: I need to purge the gate because TripleO CI gate has critical issues right now, I'll make this patch goes to the gate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Emilien Macchi (<email address hidden>) on branch: stable/ocata
Review: https://review.openstack.org/495451
Reason: I give up. We backported it downstream. This patch has been trying to merge but no success, let's stop wasting resources.

Changed in tripleo:
milestone: queens-1 → queens-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/ocata)

Reviewed: https://review.openstack.org/495451
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=5a5f546333668bcb3cf32c36afebaa68fc351eb8
Submitter: Zuul
Branch: stable/ocata

commit 5a5f546333668bcb3cf32c36afebaa68fc351eb8
Author: James Slagle <email address hidden>
Date: Thu Aug 17 14:27:30 2017 -0400

    Workaround for RHEL registration as "localhost"

    Workaround systems getting registered as "localhost" during
    RHEL registration if they don't have a fqdn set by first
    rm'ing the /etc/rhsm/facts directory. When the directory does not
    exist, the katello-rshm-consumer which runs when installing
    the katello-ca-consumer will not set the hostname.override fact to
    "localhost".

    Change-Id: Ia29aa9c775f715f9745bb7e1e4022cc395a7d092
    Partial-Bug: #1711435
    (cherry picked from commit d59ba51a1365e897b072c19c40346f0237f62c8b)

tags: added: in-stable-ocata
Changed in tripleo:
milestone: queens-2 → queens-3
Changed in tripleo:
milestone: queens-3 → queens-rc1
Changed in tripleo:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.