From nobody Wed Jan 14 12:34:04 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4drlsn2DCFz6NM2C for ; Wed, 14 Jan 2026 12:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4drlsn0R5Lz3x0G for ; Wed, 14 Jan 2026 12:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768394045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eu0bq9YbUEG5LXtPZUK7sBa4ZtPrCYGAwCmjYaYhseo=; b=bceCe/sybfg3TT3uCrVpW5JgfF2M4EBn0OiGdAO7OQ5CkngwBJ4+Sv9e2DFVXFwgwOzD9b 3v8A7FahE9mXPtStKhakbPUmgASz+R+11CIWPp2v6bdT5UPJbN8zIPt7uFvgQzctlDqaS2 Odvw6UYeV7dQYVOWSHqzJnVDjiRZqSXIPvzHwLtiEAmWfZ+YwWuTLzwjhmNHouVhp+ykVS ors72dZVXzFyeado9zTvtwSkofO74flbQ/D00TpWOZbEh4U9IflLkDwVt0OE+cSwTJx9lA RW75gpqCl21uAfb9EwPkfkURajqvynw/Mw9KACA6W13cTVSGNJcEWRLwYw8ZPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768394045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eu0bq9YbUEG5LXtPZUK7sBa4ZtPrCYGAwCmjYaYhseo=; b=WQTEjEDJ2FaA9IWr21qKSBfYa7IRhrB4V9mcBKi9xnoKLM+Ofz0Nf7dDWIb0MbyHkwRbY4 nOX/ckbXOzZsnAxXVAKSLZVSAeGpehBpLAO7MUQUM7+vt7Y7LUzslK3CX1DV38/cmvcyZC zFCeiuW5RD6PjW5lj9300ua80TMQ72TRLmI//kYzvESPsRyktpCYZ7woMIg+FuZzaCLH5y ys+oeyKH38pVPqH1zz9MFihtpagaVmIvj2jjm1k54IELUB4hDXfWun1PqpO+9hLQqzeqg9 3806frzf3YgIGTg6QdQ1dvia/XFhlut5p7Bb5KMxjnyRRyHhrDKBOiVw4Sc/AA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768394045; a=rsa-sha256; cv=none; b=fSKk/+gJAm30lOzZbN9wwrM7YEm5T5V7bRWvt92Aak0W2FxkNTSm0gPELfi1JBUqUmuTX5 Lat+lYHBVhjDa3CTfG+1q4oukBpF1emzDaOxopDjPE4xjt63QcHyjX5O27mRD2DCBix8tG XMYfRRBvJ8TdNz4FbqA2IiN8df+hLCBqd0kdkVR/Blm8tXQIWj7OwHyem0bTsyjZ6yUNtw Ry65P6Ixafdxs4DPZWjMCPSBdCnQ0IsIlGpdfRa2jawzA7CGynGqv4XZF7uQac567Ms093 ty2wICSTktBMZIrP3cQUXi96oNf4fW3EYFCaWyGK9/nDuZrSy6jldacCr5u0kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4drlsm74mWzxjy for ; Wed, 14 Jan 2026 12:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3db72 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 14 Jan 2026 12:34:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: =?utf-8?Q?Gon=C3=A9ri?= Le Bouder From: Baptiste Daroussin Subject: git: 5ba6ed861df7 - stable/14 - nuageinit: config2_network support dns service cfg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5ba6ed861df77399c8957f95ca1f62cb9865c28f Auto-Submitted: auto-generated Date: Wed, 14 Jan 2026 12:34:04 +0000 Message-Id: <69678d3c.3db72.78a208c2@gitrepo.freebsd.org> The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5ba6ed861df77399c8957f95ca1f62cb9865c28f commit 5ba6ed861df77399c8957f95ca1f62cb9865c28f Author: Gonéri Le Bouder AuthorDate: 2026-01-03 02:11:55 +0000 Commit: Baptiste Daroussin CommitDate: 2026-01-14 12:33:40 +0000 nuageinit: config2_network support dns service cfg This change enhances `config2_network()` to honor the DNS configuration, when it's defined through the `services` section. The `network_data.json` file can hold DNS configuration at two different places: - within a network configuration entry - or `dns` entry in the `services` section, in this case the configuration is global. An example of such configuration: {"links": [{"id": "interface0", "type": "phy", "ethernet_mac_address": "52:54:00:01:59:03"}], "networks": [{"id": "private-ipv4-0", "type": "ipv4", "link": "interface0", "ip_address": "192.168.123.5", "netmask": "255.255.255.0", "routes": [{"network": "0.0.0.0", "netmask": "0.0.0.0", "gateway": "192.168.123.1"}], "network_id": "9e5b1ed9-f5e6-4941-a90f-2e06bab858de", "dns_nameservers": ["192.168.123.1"], "services": [{"type": "dns", "address": "192.168.123.1"}]}], "services": [{"type": "dns", "address": "192.168.123.1"}]} See: https://docs.openstack.org/nova/latest/user/metadata.html MFC After: 1 week Signed-off-by: Gonéri Le Bouder Pull Request: https://github.com/freebsd/freebsd-src/pull/1941 (cherry picked from commit 7af8b75201b7af353fa74c8feb937b52f5ccf9bb) --- libexec/nuageinit/nuageinit | 25 ++++++++++++++++++++++++- libexec/nuageinit/nuageinit.7 | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 0870d6570d0e..aa7d1e4981e6 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -235,9 +235,16 @@ local function nameservers(interface, obj) resolv_conf_handler:close() end - if not os.execute("resolvconf -a " .. interface .. " < " .. resolv_conf) then + -- Only call resolvconf with interface if interface is provided + if interface then + resolvconf_command = "resolvconf -a " .. interface .. " < " .. resolv_conf + else + resolvconf_command = "resolvconf -u" + end + if not os.execute(resolvconf_command) then nuage.warn("Failed to execute resolvconf(8)") end + end local function install_packages(packages) @@ -571,6 +578,22 @@ local function config2_network(p) --end end end + + -- Handle global nameservers from services section + if obj["services"] then + local dns_servers = {} + for _, service in pairs(obj["services"]) do + if service["type"] == "dns" then + table.insert(dns_servers, service["address"]) + end + end + if #dns_servers > 0 then + -- Use nameservers() function for global services + local nameserver_config = {addresses = dns_servers} + nameservers(nil, nameserver_config) + end + end + if #ipv4 > 0 then routing:write('static_routes="') routing:write(table.concat(ipv4, " ") .. '"\n') diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 index bb646cf4a652..19f92873de51 100644 --- a/libexec/nuageinit/nuageinit.7 +++ b/libexec/nuageinit/nuageinit.7 @@ -117,6 +117,8 @@ file supports the following keys: Array of network interfaces to be configured. .It Ic networks Array of network configurations to be set. +.It Ic services +Array of service configurations to be set (e.g: DNS). .El .El .Pp