From a64e1d57ec139f863c1fdf6afeb5c225f0455fc2 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Mon, 15 Jul 2024 15:41:56 -0400 Subject: [PATCH] mgr/smb: enable clustering when setting up a cluster Signed-off-by: John Mulligan --- src/pybind/mgr/smb/handler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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. -- 2.39.5