Bug 1416170 - [RFE] Modify kickstart templates to update the /etc/hosts and /etc/resolv.conf
Summary: [RFE] Modify kickstart templates to update the /etc/hosts and /etc/resolv.conf
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning Templates
Version: 6.2.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-24 18:26 UTC by Peter Tselios
Modified: 2020-02-28 12:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 19:15:13 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18509 0 Normal Rejected Modify kickstart templates to update the /etc/hosts and /etc/resolv.conf 2020-02-28 12:38:39 UTC

Description Peter Tselios 2017-01-24 18:26:21 UTC
Description of problem:
Default kicstart finish templates are not updating the /etc/hosts and /etc/resolv.conf files. This creates additional useless effort to configure the host later via puppet or any other configuration management tool.

Version-Release number of selected component (if applicable):
6.2.x

How reproducible:
100%

Steps to Reproduce:
1. Provision a new host with static IPs
2. Check if the /etc/hosts file contains the hostname and the IP of the new server (it's not)
3. Check if the /etc/resolv.conf is populated.

Actual results:


Expected results:
/etc/hosts should be updated with the IP, hostname and short hostname of the new server if the IP is static.
/etc/resolv.conf should contain the DNS servers set during provisioning time. 

Foreman has all the necessary information to do so, and there is no reason to write custom snippets to do that.

Comment 1 Marek Hulan 2017-02-15 09:08:10 UTC
Created redmine issue http://projects.theforeman.org/issues/18509 from this bug

Comment 2 Marek Hulan 2017-02-15 09:47:19 UTC
I think updating /etc/hosts makes sense. I'm not sure about the resolv.conf. This is usually updated by network manager, so as long as the ifcfg-eth0 (or whatever interface file) has DNS1 set, it should be reflected when "service network restart" is called. This seems to work fine for me on el7. If that does not work in your case, could you please upload your ifcfg file or the finish template that is used to configure the host? Feel free to clean any sensitive information such as IP addresses.

Comment 3 pm-sat@redhat.com 2017-02-17 15:17:02 UTC
Upstream bug assigned to mhulan@redhat.com

Comment 4 pm-sat@redhat.com 2017-02-17 15:17:05 UTC
Upstream bug assigned to mhulan@redhat.com

Comment 5 Peter Tselios 2017-03-07 06:36:48 UTC
When I use static IPs, /etc/resolve.conf is updated correctly. 
So, let's focus on the /etc/hosts update.

Comment 6 Bryan Kearney 2018-09-04 19:02:20 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 7 Bryan Kearney 2018-09-04 19:15:13 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 8 Lukas Zapletal 2020-02-28 12:38:49 UTC
It is assumed that hosts managed by Foreman have proper DNS, therefore no changes of `/etc/hosts` is necessary. Some users tend to manage hosts file entries instead of DNS, then configuration management should be used. However, feel free to send a patch to Foreman templates to do this during provisioning, but only as opt-in via parameter. By default, we do not want to change what OS installers set.

File `/etc/resolv.conf` is managed by NetworkManager from CentOS 6, there is no need of changing it directly. Nameservers must be set in ifcfg setting (DNS1, DNS2) or interactively via NetworkManager CLI, TUI or applet.


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