ceph config set mgr mgr/cephadm/manage_etc_ceph_ceph_conf true
+If enabled, by default cephadm will update ``ceph.conf`` on all cluster hosts. To
+change the set of hosts that get a managed config file, you can update the
+``mgr/cephadm/manage_etc_ceph_ceph_conf_hosts`` setting to a different placement
+spec (see :ref:`orchestrator-cli-placement-spec`). For example, to limit config
+file updates to hosts with the ``foo`` label::
+
+ ceph config set mgr mgr/cephadm/manage_etc_ceph_ceph_conf_host label:foo
+
To set up an initial configuration before bootstrapping
the cluster, create an initial ``ceph.conf`` file. For example::
default=False,
desc='Manage and own /etc/ceph/ceph.conf on the hosts.',
),
+ Option(
+ 'manage_etc_ceph_ceph_conf_hosts',
+ type='str',
+ default='*',
+ desc='PlacementSpec describing on which hosts to manage /etc/ceph/ceph.conf',
+ ),
Option(
'registry_url',
type='str',
self.migration_current: Optional[int] = None
self.config_dashboard = True
self.manage_etc_ceph_ceph_conf = True
+ self.manage_etc_ceph_ceph_conf_hosts = '*'
self.registry_url: Optional[str] = None
self.registry_username: Optional[str] = None
self.registry_password: Optional[str] = None
from ceph.deployment import inventory
from ceph.deployment.drive_group import DriveGroupSpec
-from ceph.deployment.service_spec import ServiceSpec, IngressSpec, CustomContainerSpec
+from ceph.deployment.service_spec import ServiceSpec, IngressSpec, CustomContainerSpec, PlacementSpec
from ceph.utils import str_to_datetime, datetime_now
import orchestrator
bad_hosts = []
failures = []
+ etc_ceph_ceph_conf_hosts = []
+ if self.mgr.manage_etc_ceph_ceph_conf:
+ try:
+ pspec = PlacementSpec.from_string(self.mgr.manage_etc_ceph_ceph_conf_hosts)
+ ha = HostAssignment(
+ spec=ServiceSpec('mon', placement=pspec),
+ hosts=self.mgr._schedulable_hosts(),
+ daemons=[],
+ networks=self.mgr.cache.networks,
+ )
+ all_slots, _, _ = ha.place()
+ etc_ceph_ceph_conf_hosts = [s.hostname for s in all_slots]
+ except Exception as e:
+ self.mgr.log.warning(f'unable to calc conf hosts: {self.mgr.manage_etc_ceph_ceph_conf_hosts}: {e}')
+
@forall_hosts
def refresh(host: str) -> None:
if r:
failures.append(r)
- if self.mgr.cache.host_needs_new_etc_ceph_ceph_conf(host):
+ if (
+ host in etc_ceph_ceph_conf_hosts
+ and self.mgr.cache.host_needs_new_etc_ceph_ceph_conf(host)
+ ):
self.log.debug(f"deploying new /etc/ceph/ceph.conf on `{host}`")
r = self._deploy_etc_ceph_ceph_conf(host)
if r: