From: Stefan Sterz <s.sterz@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH 2/2] add support for bookworm enterprise ceph repo
Date: Fri, 9 Jun 2023 12:50:36 +0200 [thread overview]
Message-ID: <20230609105036.381912-3-s.sterz@proxmox.com> (raw)
In-Reply-To: <20230609105036.381912-1-s.sterz@proxmox.com>
the bookworm release of proxmox ve comes along with a new ceph
enterprise repo. this commit adds support for this new repo for
bookworm-based releases.
---
src/bin/proxmox-offline-mirror.rs | 37 ++++++++++++++++++++++++++-----
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs
index 9dfde91..ab2e535 100644
--- a/src/bin/proxmox-offline-mirror.rs
+++ b/src/bin/proxmox-offline-mirror.rs
@@ -1,4 +1,5 @@
use std::fmt::Display;
+use std::matches;
use std::path::Path;
use anyhow::{bail, format_err, Error};
@@ -270,8 +271,36 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
Some(releases.len() - 1),
)?;
- let components =
- read_string_from_tty("Enter repository components", Some("main test"))?;
+ let (base_url, components) = if matches!(release, Release::Bookworm) {
+ let variants = &[
+ (ProxmoxVariant::Enterprise, "Enterprise repository"),
+ (ProxmoxVariant::NoSubscription, "No-Subscription repository"),
+ (ProxmoxVariant::Test, "Test repository"),
+ ];
+
+ let variant =
+ read_selection_from_tty("Select repository variant", variants, Some(0))?;
+
+ match variant {
+ ProxmoxVariant::Enterprise => (
+ "https://enterprise.proxmox.com/debian/ceph",
+ "enterprise".to_string(),
+ ),
+ ProxmoxVariant::NoSubscription => (
+ "http://download.proxmox.com/debian/ceph",
+ "no-subscription".to_string(),
+ ),
+ ProxmoxVariant::Test => (
+ "http://download.proxmox.com/debian/ceph",
+ "test".to_string(),
+ ),
+ }
+ } else {
+ (
+ "http://download.proxmox.com/debian/ceph",
+ read_string_from_tty("Enter repository components", Some("main test"))?,
+ )
+ };
let key = match release {
Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg",
@@ -287,9 +316,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
CephRelease::Quincy => "quincy",
};
- let url = format!(
- "http://download.proxmox.com/debian/ceph-{ceph_release} {release} {components}"
- );
+ let url = format!("{base_url}-{ceph_release} {release} {components}");
let suggested_id = format!("ceph_{ceph_release}_{release}");
(url, key.to_string(), suggested_id, SkipConfig::default())
--
2.30.2
next prev parent reply other threads:[~2023-06-09 10:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 10:50 [pbs-devel] [PATCH 0/2] POM support bookworm releases and ceph enterprise repo Stefan Sterz
2023-06-09 10:50 ` [pbs-devel] [PATCH 1/2] add bookworm to the list of releases Stefan Sterz
2023-06-09 10:50 ` Stefan Sterz [this message]
2023-06-25 15:01 ` [pbs-devel] applied-series: [PATCH 0/2] POM support bookworm releases and ceph enterprise repo Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230609105036.381912-3-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox