NodeExporterService, SNMPGatewayService, LokiService, PromtailService
from .services.jaeger import ElasticSearchService, JaegerAgentService, JaegerCollectorService, JaegerQueryService
from .services.node_proxy import NodeProxy
+from .services.smb import SMBService
from .schedule import HostAssignment
from .inventory import Inventory, SpecStore, HostCache, AgentCache, EventStore, \
ClientKeyringStore, ClientKeyringSpec, TunedProfileStore, NodeProxyCache
PromtailService,
RbdMirrorService,
RgwService,
+ SMBService,
SNMPGatewayService,
]
'elasticsearch': PlacementSpec(count=1),
'jaeger-agent': PlacementSpec(host_pattern='*'),
'jaeger-collector': PlacementSpec(count=1),
- 'jaeger-query': PlacementSpec(count=1)
+ 'jaeger-query': PlacementSpec(count=1),
+ SMBService.TYPE: PlacementSpec(count=1),
}
spec.placement = defaults[spec.service_type]
elif spec.service_type in ['mon', 'mgr'] and \
def apply_snmp_gateway(self, spec: ServiceSpec) -> str:
return self._apply(spec)
+ @handle_orch_error
+ def apply_smb(self, spec: ServiceSpec) -> str:
+ return self._apply(spec)
+
@handle_orch_error
def set_unmanaged(self, service_name: str, value: bool) -> str:
return self.spec_store.set_unmanaged(service_name, value)
# these daemons do not use the ceph image. There are other daemons
# that also don't use the ceph image, but we only care about those
# that are part of the upgrade order here
-NON_CEPH_IMAGE_TYPES = MONITORING_STACK_TYPES + ['nvmeof']
+NON_CEPH_IMAGE_TYPES = MONITORING_STACK_TYPES + ['nvmeof', 'smb']
# Used for _run_cephadm used for check-host etc that don't require an --image parameter
cephadmNoImage = CephadmNoImage.token
Map from daemon names to ceph entity names (as seen in config)
"""
daemon_type = name.split('.', 1)[0]
- if daemon_type in ['rgw', 'rbd-mirror', 'nfs', 'crash', 'iscsi', 'ceph-exporter', 'nvmeof']:
+ if daemon_type in ['rgw', 'rbd-mirror', 'nfs', 'crash', 'iscsi', 'ceph-exporter', 'nvmeof', 'smb']:
return ConfEntity('client.' + name)
elif daemon_type in ['mon', 'osd', 'mds', 'mgr', 'client']:
return ConfEntity(name)
NFSServiceSpec,
NvmeofServiceSpec,
RGWSpec,
+ SMBSpec,
SNMPGatewaySpec,
ServiceSpec,
TunedProfileSpec,
'ingress': self.apply_ingress,
'snmp-gateway': self.apply_snmp_gateway,
'host': self.add_host,
+ 'smb': self.apply_smb,
}
def merge(l: OrchResult[List[str]], r: OrchResult[str]) -> OrchResult[List[str]]: # noqa: E741
"""Update an existing snmp gateway service"""
raise NotImplementedError()
+ def apply_smb(self, spec: SMBSpec) -> OrchResult[str]:
+ """Update a smb gateway service"""
+ raise NotImplementedError()
+
def apply_tuned_profiles(self, specs: List[TunedProfileSpec], no_overwrite: bool) -> OrchResult[str]:
"""Add or update an existing tuned profile"""
raise NotImplementedError()
'elasticsearch': 'elasticsearch',
'jaeger-agent': 'jaeger-agent',
'jaeger-collector': 'jaeger-collector',
- 'jaeger-query': 'jaeger-query'
+ 'jaeger-query': 'jaeger-query',
+ 'smb': 'smb',
}
return mapping[dtype]
'jaeger-agent': ['jaeger-agent'],
'jaeger-collector': ['jaeger-collector'],
'jaeger-query': ['jaeger-query'],
- 'jaeger-tracing': ['elasticsearch', 'jaeger-query', 'jaeger-collector', 'jaeger-agent']
+ 'jaeger-tracing': ['elasticsearch', 'jaeger-query', 'jaeger-collector', 'jaeger-agent'],
+ 'smb': ['smb'],
}
return mapping[stype]
OrchestratorError,
OrchestratorValidationError,
RGWSpec,
+ SMBSpec,
SNMPGatewaySpec,
ServiceDescription,
TunedProfileSpec,
specs: List[ServiceSpec] = spec.get_tracing_specs()
return self._apply_misc(specs, dry_run, format, no_overwrite)
+ @_cli_write_command('orch apply smb')
+ def _apply_smb(
+ self,
+ cluster_id: str,
+ config_uri: str,
+ features: str = '',
+ join_sources: Optional[List[str]] = None,
+ custom_dns: Optional[List[str]] = None,
+ include_ceph_users: Optional[List[str]] = None,
+ placement: Optional[str] = None,
+ unmanaged: bool = False,
+ dry_run: bool = False,
+ format: Format = Format.plain,
+ no_overwrite: bool = False,
+ ) -> HandleCommandResult:
+ """Apply an SMB network file system gateway service configuration."""
+
+ _features = features.replace(',', ' ').split()
+ spec = SMBSpec(
+ service_id=cluster_id,
+ placement=PlacementSpec.from_string(placement),
+ unmanaged=unmanaged,
+ preview_only=dry_run,
+ cluster_id=cluster_id,
+ features=_features,
+ config_uri=config_uri,
+ join_sources=join_sources,
+ custom_dns=custom_dns,
+ include_ceph_users=include_ceph_users,
+ )
+
+ spec.validate() # force any validation exceptions to be caught correctly
+ # The previous comment makes no sense to JJM. But when in rome.
+
+ return self._apply_misc([spec], dry_run, format, no_overwrite)
+
@_cli_write_command('orch set-unmanaged')
def _set_unmanaged(self, service_name: str) -> HandleCommandResult:
"""Set 'unmanaged: true' for the given service name"""