[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Preseed installation: definition of host/domain names



Hi,

modifying required block of preseed file to following, Debian intaller still asks to confirm hostname and domain

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain d-i netcfg/get_hostname seen true
d-i netcfg/get_domain string true 'seen true' stanza does no effect (although in this case host and domain names correct and picked up from DHCP/DNS server) What should be put into preseed file so that installation did not ask for host and domain names? Thank you Andy


On Wed, Jul 31, 2019 at 3:13 PM Polar Bear <deblist19@gmail.com> wrote:
Hello,

please find bellow an examples for "Buster" (Stretch, Jessie)

https://www.debian.org/releases/buster/example-preseed.txt

On Wed, Jul 31, 2019 at 2:39 PM Polar Bear <deblist19@gmail.com> wrote:
Hello,

can somebody explain how to configure preseed file so that auto installation picks up the host and domain name from DHCP server (DNS server).

This question was 'rised' earlier on StackExchange
https://unix.stackexchange.com/questions/106614/preseed-cfg-ignoring-hostname-setting

Situation:
I have install server (TFTP/DHCP/Apache) with several distributions and installation works fine. But there is one issue: I use LVM at disk partition step and LVM creates volume groups with hostname encoded in the name of volume group.

I went through documentation for preseed file and found it confusing as it does work differently depending on Debian release.

For example if I install 'Buster' (Debian 10) and specify in TFTP PXE configuration file hostname=dhcp domainname=dhcp then computer will get installed with name 'dhcp', I utilize Dynamic DNS update -- this name will get pushed out to register computer in DNS server with name 'dhcp' which overwrites earlier assigned name to the computer.
 (NOTE: name 'dhcp' is selected more for descriptive purpose, according the documentation preseed file should have priority -- but it does not, without specifying hostname='.....' domainname='.....' auto install stops for confirmation of hostname and domainname [which are correct in this case but require to press 'Enter' twice] even though both specified in preseed file to be auto configured by obtaining data from dhcp -- see below reference to configuration file)

All my attempts to find a solution for this issue failed so far.

What I am looking for: 
1. I register DNS record for a new computer through 'dnsupdate'
2. Add record into /etc/dhcp/dhcpd.conf (to match MAC with DNS name)
3. systemclt restart isc-dhcp-server
4. Boot 'new' computer over network (PXE)
5. Select from a menu 'Debian->Debian 10->Install preseed adm64'
6. On completion I desire to have computer assigned 'hostname' according DNS record created in step #1

Following example did not help with the issue
https://www.debian.org/releases/jessie/example-preseed.txt

-- Quote -------------------------------------
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain 

# If you want to force a hostname, regardless of what either the DHCP
# server returns or what the reverse DNS entry for the IP is, uncomment
# and adjust the following line.
#d-i netcfg/hostname string somehost
-- End of quote ---------------

On side note in 'Stretch' (Debian 9) specifying hostname=some_name and domainname=example.com in PXE configuration file is not recognized by Debian installer.

What is correct solution for this situation? 

I am interested in 'Buster', 'Stretch', 'Jessie' releases.

Thank you in advance
Andy

Reply to: