from cephadmlib.ssh import authorize_ssh_key, check_ssh_connectivity
from cephadmlib.daemon_form import (
DaemonForm,
+ UnexpectedDaemonTypeError,
create as daemon_form_create,
register as register_daemon_form,
)
from cephadmlib.deploy import DeploymentType
+from cephadmlib.container_daemon_form import ContainerDaemonForm
from cephadmlib.sysctl import install_sysctl, migrate_sysctl_dir
from cephadmlib.firewalld import Firewalld, update_firewalld
deployment_type=deployment_type,
endpoints=daemon_endpoints,
)
-
else:
- raise Error('daemon type {} not implemented in command_deploy function'
- .format(daemon_type))
+ try:
+ _deploy_daemon_container(
+ ctx, ident, daemon_endpoints, deployment_type
+ )
+ except UnexpectedDaemonTypeError:
+ raise Error('daemon type {} not implemented in command_deploy function'
+ .format(daemon_type))
+
+
+def _deploy_daemon_container(
+ ctx: CephadmContext,
+ ident: 'DaemonIdentity',
+ daemon_endpoints: List[EndPoint],
+ deployment_type: DeploymentType,
+) -> None:
+ daemon = daemon_form_create(ctx, ident)
+ assert isinstance(daemon, ContainerDaemonForm)
+ daemon.customize_container_endpoints(daemon_endpoints, deployment_type)
+ ctr = daemon.container(ctx)
+ ics = daemon.init_containers(ctx)
+ config, keyring = daemon.config_and_keyring(ctx)
+ uid, gid = daemon.uid_gid(ctx)
+ deploy_daemon(
+ ctx,
+ ident,
+ ctr,
+ uid,
+ gid,
+ config=config,
+ keyring=keyring,
+ deployment_type=deployment_type,
+ endpoints=daemon_endpoints,
+ osd_fsid=daemon.osd_fsid,
+ init_containers=ics,
+ )
##################################