[pve-devel] [PATCH v2 pve-storage 07/11] amend! cephconfig: allow writing arbitrary sections

Max Carrara m.carrara at proxmox.com
Mon Feb 5 18:54:15 CET 2024


cephconfig: allow writing arbitrary sections

This adds support for writing arbitrary sections to 'ceph.conf' while
ensuring that already written sections are not duplicated.

Sections that are associated with the client, for example
'[client.foo]', are written directly after the '[client]' section.

Sections associated with 'mds', 'mon', 'osd' and 'mgr' are also
written directly after their associated section.

Signed-off-by: Max Carrara <m.carrara at proxmox.com>
---
NOTE: This amend really just changes the order of the sections below and
      may be dropped if not desired.

Changes v1 --> v2:
  * new

 src/PVE/CephConfig.pm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/PVE/CephConfig.pm b/src/PVE/CephConfig.pm
index 86d3079..00b1f35 100644
--- a/src/PVE/CephConfig.pm
+++ b/src/PVE/CephConfig.pm
@@ -82,17 +82,20 @@ sub write_ceph_config {
     };
 
     &$cond_write_sec('global');
+
     &$cond_write_sec('client');
     &$cond_write_sec('client\..*');
 
     &$cond_write_sec('mds');
-    &$cond_write_sec('mon');
-    &$cond_write_sec('osd');
-    &$cond_write_sec('mgr');
-
     &$cond_write_sec('mds\..*');
+
+    &$cond_write_sec('mon');
     &$cond_write_sec('mon\..*');
+
+    &$cond_write_sec('osd');
     &$cond_write_sec('osd\..*');
+
+    &$cond_write_sec('mgr');
     &$cond_write_sec('mgr\..*');
 
     &$cond_write_sec('.*');
-- 
2.39.2





More information about the pve-devel mailing list