From nobody Mon Jun 23 07:44:17 2025 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 4bQg816rZrz5ywk6; Mon, 23 Jun 2025 07:44:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg815nS7z4CN6; Mon, 23 Jun 2025 07:44:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdNFJSV7w1zpOMUmlR3xUKmOwAZ+32BF+ZMprH5KRUM=; b=eJIIuyEWVLgyiz6zddSvNrmBk+bmZjdkyPk1O3kiDH0Pu1XWq0NnRyRSRN+ltxEP3bOcsT 1T3DeuGG7r+oI0hGO84njfHj04w9LxJ/0mCF7qJq4pcFwXjMrNKRh5hu3a9MQyrqZl03MS 2QOMT/BtsBkih1nO5dKPxpV2XAX9fWeK4Hu/i3XCRmTbwtYvbnzYNZfNAtZcjflML5T8aL 43vPIVh/kz8ayRksc6PmbLGL6sQA3xpd7B5+ALCGzVFdPW9jJwY0sBEyt3oA++Wr598tfW YNT2VGZSSy5pvo4Psw3PaznrimD5ZqkvWU34Zy+0xpsLW/76C1w9nDUgpaWH9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdNFJSV7w1zpOMUmlR3xUKmOwAZ+32BF+ZMprH5KRUM=; b=hOKKgR2ju8dF4QNCbnlkJg3qX7i0IJmcABXC6wNpH5vm+4Yh3hpcWh3ZKktsznSUdtBgrf SgePQcizR7jaVSRqicwg6E92k6dtI6Ogx29PYZOA2AA+X7qOvni6mjzUNPQXfBiYKYZiGy wwG3DzrdCYgwyT3NGiGjm2we3VmHJj8FDn3hkvkCufK0Or3QSBbZyUVjQtLWVL4035oipU sne7jIERlbHDP30v8MYEtz329iTHIqNS2BOzzHTqgGUqbuMPap5VQpPhFKsAMYu0HbiO61 GyEmCp85ynGQCgCcNRzseZmIVWy1cnS0vrIMTQAEryZFSDbFDiU7jDtcrWv1DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664657; a=rsa-sha256; cv=none; b=ShlqlyW38ek6fe8fTqDZIGYNLjSulWkchswfcReyncsEeYFIAuWLHhiE8iPsokBmYvVv3C SAlHDGfCnIome+Fdg27CA+RW/10YosgB7YuHTmuU+qQxMXzCBjpzjFpxFVsH1RGQl2+jLl osPwlVse6CZf3MkR2GXYqGBFMhiRiuxQf5jucUiBwq48OyHTTEdRiTaj7w9yH4wnb5nVw9 emf1GQFV6ZYlsiqjReTuq4zAURTjHAviEgL9SfpaNQbqznCE1kF0QHYZYmsO+kzrxQ8ZQR Lmhg3i2iEPJsenNzH2cKeWg0z64go48cRVOYJfvEfw1nZxvMSBcON5rJv2x9jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bQg815NmwztGs; Mon, 23 Jun 2025 07:44:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55N7iHXM067422; Mon, 23 Jun 2025 07:44:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iHj3067419; Mon, 23 Jun 2025 07:44:17 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:17 GMT Message-Id: <202506230744.55N7iHj3067419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 3406fba999d1 - stable/14 - nuageinit: support "fqdn" and "hostname" 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: 3406fba999d1e86d8b3f1580fcb4748d733ffb7a Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3406fba999d1e86d8b3f1580fcb4748d733ffb7a commit 3406fba999d1e86d8b3f1580fcb4748d733ffb7a Author: Baptiste Daroussin AuthorDate: 2025-06-14 18:49:44 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:13 +0000 nuageinit: support "fqdn" and "hostname" (cherry picked from commit f1dd507b2c44f16c94395e67f82125c491ebddf2) --- libexec/nuageinit/nuageinit | 6 ++++++ libexec/nuageinit/tests/nuageinit.sh | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index c874f40b38a8..c1026aa2afee 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -249,6 +249,12 @@ if line == "#cloud-config" then if not obj then nuage.err("error parsing cloud-config file: " .. ud) end + -- always prefer fqdn is specified over hostname + if obj.fqdn then + nuage.sethostname(obj.fqdn) + elseif obj.hostname then + nuage.sethostname(obj.hostname) + end if obj.groups then for n, g in pairs(obj.groups) do if (type(g) == "string") then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 3d0033a648de..edcc80346b5d 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -28,6 +28,7 @@ atf_test_case config2_userdata_packages atf_test_case config2_userdata_update_packages atf_test_case config2_userdata_upgrade_packages atf_test_case config2_userdata_shebang +atf_test_case config2_userdata_fqdn_and_hostname setup_test_adduser() { @@ -837,6 +838,26 @@ EOF fi } +config2_userdata_fqdn_and_hostname_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data < media/nuageinit/user_data <