Bug 1412352
Summary: | rhel-registration script broken with satellite 6.2.5+ | ||
---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Jason Montleon <jmontleo> |
Component: | diskimage-builder | Assignee: | James Slagle <jslagle> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Gurenko Alex <agurenko> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 10.0 (Newton) | CC: | aschultz, bnemec, emacchi, greartes, jcoufal, jmontleo, jslagle, mburns, rhel-osp-director-maint |
Target Milestone: | Upstream M2 | Keywords: | Triaged, ZStream |
Target Release: | 10.0 (Newton) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | openstack-tripleo-heat-templates-5.3.0-5 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-12 21:48:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1411935 |
Description
Jason Montleon
2017-01-11 20:18:24 UTC
The script being run is from the plan: extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration Although I see 06-rhel-registration running on the hosts in /var/log/messages it appears it's not actually doing anything as it's exiting in a couple seconds. Again `hostname -f` is returning localhost because /etc/hosts has not been populated yet and the name does not resolve from DNS, despite the hostname being set. To workaround this I added the line: echo "{\"network.hostname\":\"$HOSTNAME\"}" > /etc/rhsm/facts/katello.facts immediately after: rpm -Uvh katello-ca-consumer-latest.noarch.rpm || true The registration process then goes on using the correct hostname. This might be a duplicate of BZ#1421228 The NodeExtraConfig resource that is mapped to rhel registration definitely comes before the {{role.name}}HostsDeployment in the templates. Still, I would have expected cloud-init to have already set the hostname. If the workaround from comment 1 works, then let's just add that to tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration as the fix. Perhaps we could use hostnamectl to get the hostname though instead of $HOSTNAME. Would have to investigate that. James has this. Cancelling needinfo. can you clarify if you are building rhel images with diskimage-builder and registering them to satellite during that image build process? Or, only attempting to register the unmodified director images to satellite with the extraconfig/pre_deploy/rhel-registration/environment-rhel-registration.yaml template from tripleo-heat-templates? From what I can tell, katello-ca-consumer would only be installed by either the script during the image build or during the overcloud deploy. If used during the image build, then I'm not surprised the hostname is "localhost". If used during the overcloud deploy, then the hostname should be set by cloud-init, and if it's not then we need to investigate why that's not the case. Or possibly if you're doing both, then the image build fact is still taking precedence. there are a few more details on https://bugzilla.redhat.com/show_bug.cgi?id=1476760 I believe I've tracked this down to Heat configuring /etc/hosts after rhel registration. This is a change from when we were using the 51-hosts script to configure /etc/hosts. Since satellite forces a hostname override in /etc/rhsm/facts/katello.facts to the result of "hostname -f", if /etc/hosts is not configured, that value will always be localhost. as i mentioned in the other bug, a quick fix may be to rm /etc/rhsm/facts/katello.facts after katello-ca-consumer is installed in the rhel-registration script |