From: Abhishek Desai Date: Thu, 19 Feb 2026 09:08:33 +0000 (+0530) Subject: mgr/dashboard : Add cephadm config params to dashboard X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=943060fcc0be24338a1c012228e14f26bf78ab48;p=ceph.git mgr/dashboard : Add cephadm config params to dashboard fixes : https://tracker.ceph.com/issues/75109 Signed-off-by: Abhishek Desai --- diff --git a/src/pybind/mgr/dashboard/controllers/cluster_configuration.py b/src/pybind/mgr/dashboard/controllers/cluster_configuration.py index 292f381d79f..eeda4289eb8 100644 --- a/src/pybind/mgr/dashboard/controllers/cluster_configuration.py +++ b/src/pybind/mgr/dashboard/controllers/cluster_configuration.py @@ -33,6 +33,44 @@ FILTER_SCHEMA = [{ @APIDoc("Manage Cluster Configurations", "ClusterConfiguration") class ClusterConfiguration(RESTController): + def _get_cephadm_options(self): + """ + Fetches all cephadm module options and formats them like config options. + :return: list of cephadm options formatted as config options + """ + cephadm_options = [] + mgr_map = mgr.get('mgr_map') + + # Get cephadm module config from mgr_map + cephadm_module_config = None + for module_config in mgr_map.get('available_modules', []): + if module_config['name'] == 'cephadm': + cephadm_module_config = module_config + break + + if not cephadm_module_config: + return cephadm_options + + module_options = cephadm_module_config.get('module_options', {}) + + for option_name, opt in module_options.items(): + current_value = mgr.get_module_option_ex( + 'cephadm', option_name, opt.get('default_value')) + + option = dict(opt) + option['name'] = f'mgr/cephadm/{option_name}' + option['default'] = option.pop('default_value', None) + option['daemon_default'] = option['default'] + option['enum_values'] = option.pop('enum_allowed', []) + option['services'] = ['mgr'] + option['can_update_at_runtime'] = True + option['value'] = [{'section': 'mgr', 'value': current_value}] + option['source'] = 'mgr_module' + + cephadm_options.append(option) + + return cephadm_options + def _append_config_option_values(self, options): """ Appends values from the config database (if available) to the given options @@ -56,7 +94,10 @@ class ClusterConfiguration(RESTController): def list(self): options = mgr.get('config_options')['options'] - return self._append_config_option_values(options) + options = self._append_config_option_values(options) + # Append all cephadm module options + options.extend(self._get_cephadm_options()) + return options def get(self, name): return self._get_config_option(name) @@ -127,6 +168,10 @@ class ClusterConfiguration(RESTController): if option['name'] == name: return self._append_config_option_values([option])[0] + for cephadm_option in self._get_cephadm_options(): + if cephadm_option['name'] == name: + return cephadm_option + raise cherrypy.HTTPError(404) def _updateable_at_runtime(self, config_option_names, force_update=False): diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts index 47c45dabc11..1fb4b4cf465 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration.component.ts @@ -72,13 +72,40 @@ export class ConfigurationComponent extends ListWithDetails implements OnInit { { name: $localize`Source`, prop: 'source', - filterOptions: ['mon'], + filterOptions: ['mon', 'mgr_module'], filterPredicate: (row, value) => { if (!row.hasOwnProperty('source')) { return false; } return row.source.includes(value); } + }, + { + name: $localize`Module`, + prop: 'module', + filterOptions: ['cephadm'], + filterPredicate: (row, value) => { + if (value === 'cephadm') { + return row.name?.startsWith('mgr/cephadm/'); + } + return false; + } + }, + { + name: $localize`Category`, + prop: 'category', + filterOptions: [$localize`certificate`], + filterPredicate: (row, value) => { + if (value === 'certificate') { + return ( + row.name?.toLowerCase().includes('certificate') || + row.name?.toLowerCase().includes('cert') || + row.name?.toLowerCase().includes('ssl') || + row.name?.toLowerCase().includes('tls') + ); + } + return false; + } } ];