]> git.proxmox.com Git - pve-installer.git/commitdiff
auto-installer: utils: define ISO specified settings
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 17 Apr 2024 12:31:05 +0000 (14:31 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Apr 2024 12:31:37 +0000 (14:31 +0200)
These will be expected on the ISO itself and define the behavior of the
automated installation.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-auto-installer/src/utils.rs

index ff90ae88e58ea103d05e81c9663fc69a18c362ef..997ab3423ad17e306444578f3a6f9265c24a35f7 100644 (file)
@@ -1,4 +1,5 @@
 use anyhow::{bail, Result};
+use clap::ValueEnum;
 use glob::Pattern;
 use log::info;
 use std::{
@@ -14,7 +15,7 @@ use proxmox_installer_common::{
     options::{FsType, NetworkOptions, ZfsChecksumOption, ZfsCompressOption},
     setup::{InstallConfig, InstallZfsOption, LocaleInfo, RuntimeInfo, SetupInfo},
 };
-use serde::Deserialize;
+use serde::{Deserialize, Serialize};
 
 fn find_with_glob(pattern: &str, value: &str) -> Result<bool> {
     let p = Pattern::new(pattern)?;
@@ -72,6 +73,23 @@ pub fn get_single_udev_index(
     Ok(dev_index.unwrap())
 }
 
+#[derive(Deserialize, Serialize, Debug, Clone, ValueEnum, PartialEq)]
+#[serde(rename_all = "lowercase", deny_unknown_fields)]
+pub enum AutoInstModes {
+    Auto,
+    Included,
+    Http,
+    Partition,
+}
+
+#[derive(Deserialize, Serialize, Debug)]
+#[serde(rename_all = "lowercase", deny_unknown_fields)]
+pub struct AutoInstSettings {
+    pub mode: AutoInstModes,
+    pub http_url: Option<String>,
+    pub cert_fingerprint: Option<String>,
+}
+
 #[derive(Deserialize, Debug)]
 struct IpLinksUdevInfo {
     ifname: String,