Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37098 - setting the hostname from the primary interface #10013

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ test_on:
.map { |add_on| "--addon '#{add_on.strip}'" }.join(" ")}" if host_param('syspurpose_addons')
-%>
<% if subman_registration -%>
%pre
hostnamectl set-hostname --static <%= @host.name %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please comment here why it is necessary, the same way described in the https://projects.theforeman.org/issues/37098?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provisioning a RHEL9 system with a dedicated nic for provisioning and another as primary results in a duplicated host created on satellite, with the name defined on the provisioning interface.

This happens because we're using the rhsm component of Anaconda to register the system. At that point of the installation, the host is using the hostname that it got from the DHCP. Then it registers into Satellite with that name.

Later, the anaconda will update the name for the name of the primary interface, but at that point, the extra host already exists on Satellite.

This change sets the expected hostname to the host early during the installation avoiding this situation.

%end
rhsm --organization="<%= subman_org %>" --activation-key="<%= subman_keys %>"<%= subman_hostname -%><%= subman_rhsm_baseurl -%><%= subman_insights -%>
<% end -%>
<%- if host_param('syspurpose_role') %>
Expand Down
Loading