[pve-devel] [PATCH installer 11/14] auto-installer: answer: add `posthook` section

Christoph Heiss c.heiss at proxmox.com
Wed Jul 10 15:27:50 CEST 2024


Adds a new global, optional section to the answerfile.

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
 proxmox-auto-installer/src/answer.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installer/src/answer.rs
index aab7198..e27a321 100644
--- a/proxmox-auto-installer/src/answer.rs
+++ b/proxmox-auto-installer/src/answer.rs
@@ -16,6 +16,8 @@ pub struct Answer {
     pub network: Network,
     #[serde(rename = "disk-setup")]
     pub disks: Disks,
+    #[serde(default)]
+    pub posthook: Option<PostNotificationHookInfo>,
 }
 
 #[derive(Clone, Deserialize, Debug)]
@@ -33,6 +35,15 @@ pub struct Global {
     pub root_ssh_keys: Vec<String>,
 }
 
+#[derive(Clone, Deserialize, Debug)]
+#[serde(deny_unknown_fields)]
+pub struct PostNotificationHookInfo {
+    /// URL to send a POST request to
+    pub url: String,
+    /// SHA256 cert fingerprint if certificate pinning should be used.
+    pub cert_fingerprint: Option<String>,
+}
+
 #[derive(Clone, Deserialize, Debug, Default, PartialEq)]
 #[serde(deny_unknown_fields)]
 enum NetworkConfigMode {
-- 
2.45.1





More information about the pve-devel mailing list