-
Notifications
You must be signed in to change notification settings - Fork 993
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
base: develop
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
@@ -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 %> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Waiting for QA review: https://issues.redhat.com/browse/SAT-22579 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to avoid using %pre
if there is a proper way. We already push the hostname on the network here:
foreman/app/views/unattended/provisioning_templates/provision/kickstart_default.erb
Line 125 in bbca473
network_options.push("--hostname #{@host.name}") |
So the question is, why isn't that used. I suspect it's because we don't set up the networking properly and only use the network
statement for the provisioning interface. #9961 aims to solve that.
If the hostname of the machine itself needs to be set while booting, then the proper place to solve it is probably in the boot. https://anaconda-installer.readthedocs.io/en/latest/boot-options.html#ip describes how to do that with Anaconda. https://github.com/theforeman/foreman/blob/develop/app/views/unattended/provisioning_templates/snippet/kickstart_kernel_options.erb is where we send those. The challenge here is probably that we use DHCP mode where the hostname isn't set.
Hi, there has been a change in configuring network interfaces during the provisioning; we are now using the Can you please check if the problem still occurs with the new behavior? |
Setting the hostname from the primary interface