From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id F30521FF0ED for ; Fri, 31 Jul 2026 16:40:30 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C41F92158A; Fri, 31 Jul 2026 16:40:30 +0200 (CEST) From: Christoph Heiss To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 13/16] config: auto-install: add optional `post-hook-add-as-remote` field Date: Fri, 31 Jul 2026 16:35:36 +0200 Message-ID: <20260731143910.936881-14-c.heiss@proxmox.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260731143910.936881-1-c.heiss@proxmox.com> References: <20260731143910.936881-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785508818501 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.006 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: DL7FAGFWQ7AUWHLXIUEVLC7DILWSOHPY X-Message-ID-Hash: DL7FAGFWQ7AUWHLXIUEVLC7DILWSOHPY X-MailFrom: c.heiss@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Christoph Heiss --- lib/pdm-config/src/auto_install.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/pdm-config/src/auto_install.rs b/lib/pdm-config/src/auto_install.rs index 8ac48fb6..68bc63a0 100644 --- a/lib/pdm-config/src/auto_install.rs +++ b/lib/pdm-config/src/auto_install.rs @@ -149,6 +149,9 @@ pub mod types { schema: CERT_FINGERPRINT_SHA256_SCHEMA, optional: true, }, + "post-hook-add-as-remote": { + optional: true, + }, "template-counters": { type: String, optional: true, @@ -280,6 +283,11 @@ pub mod types { /// Post hook certificate fingerprint, if needed. #[serde(default, skip_serializing_if = "Option::is_none")] pub post_hook_cert_fp: Option, + /// Whether to add the target host as new remote to PDM after the installation. + /// + /// Only available with PVE and PBS. + #[serde(default, skip_serializing_if = "bool_is_false")] + pub post_hook_add_as_remote: bool, /// Key-value pairs of (auto-incrementing) counters. #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] @@ -328,6 +336,7 @@ pub mod types { // post hook post_hook_base_url: conf.post_hook_base_url, post_hook_cert_fp: conf.post_hook_cert_fp, + post_hook_add_as_remote: conf.post_hook_add_as_remote, // templating template_counters: PropertyString::new(BTreeMapWrapper(conf.template_counters)), // subscription @@ -381,6 +390,7 @@ pub mod types { // post hook post_hook_base_url: self.post_hook_base_url, post_hook_cert_fp: self.post_hook_cert_fp, + post_hook_add_as_remote: self.post_hook_add_as_remote, // templating template_counters: self.template_counters.into_inner().0, // subscription @@ -427,6 +437,10 @@ pub mod types { AnswerTokenWrapper::Token(value) } } + + fn bool_is_false(b: &bool) -> bool { + !b + } } pub fn installations_read_lock() -> Result { -- 2.54.0