public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH installer] post-hook: save post hook data to /run/proxmox-installer
@ 2025-12-19 14:06 Christoph Heiss
  0 siblings, 0 replies; only message in thread
From: Christoph Heiss @ 2025-12-19 14:06 UTC (permalink / raw)
  To: pve-devel

Having the sent post-hook data available somewhere in the installatino
environment after the fact is seful for easily inspecting a
failed/rejected post-hook.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
It's a rather niche thing and more useful to developers than users.
Added this while working on the PDM integration, and thought it might be
nice to have this in general, especially since it does not have any
other impact.

 proxmox-post-hook/src/main.rs | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/proxmox-post-hook/src/main.rs b/proxmox-post-hook/src/main.rs
index 9989389..a1aee1c 100644
--- a/proxmox-post-hook/src/main.rs
+++ b/proxmox-post-hook/src/main.rs
@@ -662,6 +662,15 @@ fn do_main() -> Result<()> {
 
         let info = with_chroot(|target_path| PostHookInfo::gather(target_path, &answer))?;
 
+        if let Err(err) = fs::write(
+            "/run/proxmox-installer/post-hook-data.json",
+            serde_json::to_string_pretty(&info)?,
+        ) {
+            eprintln!(
+                "Failed to write post-installation-webhook data to /run/proxmox-installer: {err:#}"
+            );
+        }
+
         proxmox_installer_common::http::post(
             url,
             cert_fingerprint.as_deref(),
-- 
2.51.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-19 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-19 14:06 [pve-devel] [PATCH installer] post-hook: save post hook data to /run/proxmox-installer Christoph Heiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal