From: John Mulligan Date: Mon, 15 Jul 2024 19:41:56 +0000 (-0400) Subject: mgr/smb: enable clustering when setting up a cluster X-Git-Tag: testing/wip-vshankar-testing-20240826.122843-debug~13^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a64e1d57ec139f863c1fdf6afeb5c225f0455fc2;p=ceph-ci.git mgr/smb: enable clustering when setting up a cluster Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/smb/handler.py b/src/pybind/mgr/smb/handler.py index 7c0c6456777..740f7779af5 100644 --- a/src/pybind/mgr/smb/handler.py +++ b/src/pybind/mgr/smb/handler.py @@ -56,6 +56,7 @@ ClusterRef = Union[resources.Cluster, resources.RemovedCluster] ShareRef = Union[resources.Share, resources.RemovedShare] _DOMAIN = 'domain' +_CLUSTERED = 'clustered' log = logging.getLogger(__name__) @@ -1122,12 +1123,15 @@ def _generate_config( for share in shares } + instance_features = [] + if cluster.is_clustered(): + instance_features.append('ctdb') cfg: Dict[str, Any] = { 'samba-container-config': 'v0', 'configs': { cluster.cluster_id: { 'instance_name': cluster.cluster_id, - 'instance_features': [], + 'instance_features': instance_features, 'globals': ['default', cluster.cluster_id], 'shares': list(share_configs.keys()), }, @@ -1168,6 +1172,8 @@ def _generate_smb_service_spec( features = [] if cluster.auth_mode == AuthMode.ACTIVE_DIRECTORY: features.append(_DOMAIN) + if cluster.is_clustered(): + features.append(_CLUSTERED) # only one config uri can be used, the input list should be # ordered from lowest to highest priority and the highest priority # item that exists in the store will be used.