From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 82A9A1FF396 for ; Thu, 23 May 2024 14:20:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1CA5D1F3C2; Thu, 23 May 2024 14:20:21 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Thu, 23 May 2024 14:19:33 +0200 Message-ID: <20240523121938.1058898-6-c.heiss@proxmox.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240523121938.1058898-1-c.heiss@proxmox.com> References: <20240523121938.1058898-1-c.heiss@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.006 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 Subject: [pve-devel] [PATCH installer 5/7] auto-installer: adapt to new `root_password` plain/hashed setup option X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Christoph Heiss --- proxmox-auto-installer/src/utils.rs | 9 +++++++-- .../tests/resources/parse_answer/disk_match.json | 2 +- .../tests/resources/parse_answer/disk_match_all.json | 2 +- .../tests/resources/parse_answer/disk_match_any.json | 2 +- .../tests/resources/parse_answer/minimal.json | 2 +- .../tests/resources/parse_answer/nic_matching.json | 2 +- .../tests/resources/parse_answer/specific_nic.json | 2 +- .../tests/resources/parse_answer/zfs.json | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/proxmox-auto-installer/src/utils.rs b/proxmox-auto-installer/src/utils.rs index 202ad41..f1425b0 100644 --- a/proxmox-auto-installer/src/utils.rs +++ b/proxmox-auto-installer/src/utils.rs @@ -10,7 +10,9 @@ use crate::{ }; use proxmox_installer_common::{ options::{FsType, NetworkOptions, ZfsChecksumOption, ZfsCompressOption}, - setup::{InstallConfig, InstallZfsOption, LocaleInfo, RuntimeInfo, SetupInfo}, + setup::{ + InstallConfig, InstallRootPassword, InstallZfsOption, LocaleInfo, RuntimeInfo, SetupInfo, + }, }; use serde::{Deserialize, Serialize}; @@ -334,7 +336,10 @@ pub fn parse_answer( timezone: answer.global.timezone.clone(), keymap: answer.global.keyboard.to_string(), - password: answer.global.root_password.clone(), + root_password: InstallRootPassword { + plain: answer.global.root_password.clone(), + hashed: None, + }, mailto: answer.global.mailto.clone(), root_ssh_keys: answer.global.root_ssh_keys.clone(), diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json index 3a117b6..a0942cc 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match.json @@ -18,7 +18,7 @@ "keymap": "de", "mailto": "mail@no.invalid", "mngmt_nic": "eno1", - "password": "123456", + "root_password": { "plain": "123456" }, "timezone": "Europe/Vienna", "zfs_opts": { "arc_max": 2048, diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json index 5325fc3..a7324f1 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_all.json @@ -15,7 +15,7 @@ "keymap": "de", "mailto": "mail@no.invalid", "mngmt_nic": "eno1", - "password": "123456", + "root_password": { "plain": "123456" }, "timezone": "Europe/Vienna", "zfs_opts": { "arc_max": 2048, diff --git a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json index 18e22d1..8e13496 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/disk_match_any.json @@ -22,7 +22,7 @@ "keymap": "de", "mailto": "mail@no.invalid", "mngmt_nic": "eno1", - "password": "123456", + "root_password": { "plain": "123456" }, "timezone": "Europe/Vienna", "zfs_opts": { "arc_max": 2048, diff --git a/proxmox-auto-installer/tests/resources/parse_answer/minimal.json b/proxmox-auto-installer/tests/resources/parse_answer/minimal.json index bb72713..7a6bfd5 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/minimal.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/minimal.json @@ -12,7 +12,7 @@ "keymap": "de", "mailto": "mail@no.invalid", "mngmt_nic": "eno1", - "password": "123456", + "root_password": { "plain": "123456" }, "target_hd": "/dev/sda", "timezone": "Europe/Vienna" } diff --git a/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json b/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json index de94165..e1c9d12 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/nic_matching.json @@ -12,7 +12,7 @@ "keymap": "de", "mailto": "mail@no.invalid", "mngmt_nic": "enp65s0f0", - "password": "123456", + "root_password": { "plain": "123456" }, "target_hd": "/dev/sda", "timezone": "Europe/Vienna" } diff --git a/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json b/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json index 5b4fcfc..1187eb4 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/specific_nic.json @@ -12,7 +12,7 @@ "keymap": "de", "mailto": "mail@no.invalid", "mngmt_nic": "enp129s0f1np1", - "password": "123456", + "root_password": { "plain": "123456" }, "target_hd": "/dev/sda", "timezone": "Europe/Vienna" } diff --git a/proxmox-auto-installer/tests/resources/parse_answer/zfs.json b/proxmox-auto-installer/tests/resources/parse_answer/zfs.json index 65724a8..8229a4b 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer/zfs.json +++ b/proxmox-auto-installer/tests/resources/parse_answer/zfs.json @@ -16,7 +16,7 @@ "keymap": "de", "mailto": "mail@no.invalid", "mngmt_nic": "eno1", - "password": "123456", + "root_password": { "plain": "123456" }, "timezone": "Europe/Vienna", "zfs_opts": { "arc_max": 2048, -- 2.44.0 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel