From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 2638E1FF172
	for <inbox@lore.proxmox.com>; Tue,  1 Apr 2025 15:46:00 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 18CE233825;
	Tue,  1 Apr 2025 15:45:50 +0200 (CEST)
Message-ID: <02e7804d-ab22-4c30-b44f-ad6c032acc05@proxmox.com>
Date: Tue, 1 Apr 2025 15:45:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Christoph Heiss <c.heiss@proxmox.com>
References: <20250327151718.1084841-1-c.heiss@proxmox.com>
Content-Language: en-US
From: Daniel Kral <d.kral@proxmox.com>
In-Reply-To: <20250327151718.1084841-1-c.heiss@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.011 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [proxmox.com, something.com]
Subject: Re: [pve-devel] [PATCH installer 0/6] fix #5811: add option to
 retrieve FQDN from DHCP configuration
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

On 3/27/25 16:17, Christoph Heiss wrote:
> Fixes #5811 [0].
> 
> Adds a new option to the answer file for specifying to use the
> DHCP-provided hostname and domain. For the domain, an additional
> fallback/default can be specified, in case the DHCP server only provides
> hostnames. The hostname is always required in this mode.
> 
> The addition to the answer file format is done in a backwards-compatible
> way.
> 
> Users can now specify the following to use the DHCP-provided domain:
> 
> ```
> [global]
> fqdn.source = "from-dhcp"
> ```
> 
> or additionally with a custom domain:
> 
> ```
> [global.fqdn]
> source = "from-dhcp"
> domain = "custom.domain.local"
> ```
> 
> Patches #1 through #4 can all be applied independently, #1 & #4 are pure
> cleanups.
> 
> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=5811
> 
> Diffstat
> ========
> 
> Christoph Heiss (6):
>    auto: utils: avoid a force unwrap()
>    auto: tests: parse-answer: allow per-test runtime env
>    auto: tests: allow testing for serde parse errors of answer files
>    tui, common: move network option tests to correct crate
>    common: options: allow user-supplied domain for network options
>    fix #5811: auto: add option to retrieve FQDN from DHCP configuration

Tested this patch series with setting up a DHCP server through dnsmasq, 
where I set up the dnsmasq with `dhcp-fqdn` and `domain=something.com` 
for the domain part, and `dhcp-host=<MAC>,<IPaddr>,<HOSTNAME>`.

I tested `global.fqdn.source = 'from-dhcp'` with both 
`global.fqdn.domain` set and unset for:

- not setting hostnames nor domain at all -> correctly errors for both,
- setting a hostname but no domain -> correctly errors for unset domain, 
works as expected with fallback domain,
- setting no hostname but a domain -> correctly errors for both,
- setting both a hostname and a domain -> works as expected.

Also tested that for the working cases these are set as the fqdn after 
installation, and also tested that setting `fqdn = "some.local.domain"` 
also still works as expected as before.

Works great!

Just wanted to ask: Would it make sense to also have a fallback for the 
hostname if the DHCP server does only provide a domain but no hostname 
here or should the DHCP provide the full FQDN?

Else, consider this series as:

Tested-by: Daniel Kral <d.kral@proxmox.com>


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel