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

Max Carrara m.carrara at proxmox.com
Tue Feb 13 09:50:27 CET 2024


On 2/12/24 14:33, Fabian Grünbichler wrote:
> On February 5, 2024 6:54 pm, Max Carrara wrote:
>> 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.
> 
> does the order matter at all? the docs would imply that it doesn't,
> since there is a clear precedence between [global], [$type], and
> [$type.$id] (e.g., global -> client -> client.crash)..

No, it doesn't - I perhaps should've worded this a little more clearly;
this change is purely cosmetic and just makes it so each '[$type]' is followed
by its respective '[$type.$id]'.

> 
> https://docs.ceph.com/en/latest/rados/configuration/ceph-conf/#configuration-sections
> 
>>
>> 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
>>
>>
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel at lists.proxmox.com
>> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>>
>>
>>
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 





More information about the pve-devel mailing list