from ceph.deployment.service_spec import \
ServiceSpec, PlacementSpec, \
HostPlacementSpec, IngressSpec, \
- TunedProfileSpec, PrometheusSpec
+ TunedProfileSpec, PrometheusSpec, IscsiServiceSpec
from ceph.utils import str_to_datetime, datetime_to_str, datetime_now
from cephadm.serve import CephadmServe
from cephadm.services.cephadmservice import CephadmDaemonDeploySpec
self.mgr_service: MgrService = cast(MgrService, self.cephadm_services['mgr'])
self.osd_service: OSDService = cast(OSDService, self.cephadm_services['osd'])
+ self.iscsi_service: IscsiService = cast(IscsiService, self.cephadm_services['iscsi'])
self.template = TemplateMgr(self)
deps = sorted([self.get_mgr_ip(), server_port, root_cert,
str(self.device_enhanced_scan)])
elif daemon_type == 'iscsi':
- deps = [self.get_mgr_ip()]
-
+ if spec:
+ iscsi_spec = cast(IscsiServiceSpec, spec)
+ deps = [self.iscsi_service.get_trusted_ips(iscsi_spec)]
+ else:
+ deps = [self.get_mgr_ip()]
elif daemon_type == 'prometheus':
# for prometheus we add the active mgr as an explicit dependency,
# this way we force a redeploy after a mgr failover
assert spec.pool
self.mgr._check_pool_exists(spec.pool, spec.service_name())
+ def get_trusted_ips(self, spec: IscsiServiceSpec) -> str:
+ # add active mgr ip address to trusted list so dashboard can access
+ trusted_ip_list = spec.trusted_ip_list if spec.trusted_ip_list else ''
+ if trusted_ip_list:
+ trusted_ip_list += ','
+ trusted_ip_list += self.mgr.get_mgr_ip()
+ return trusted_ip_list
+
def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonDeploySpec:
assert self.TYPE == daemon_spec.daemon_type
'val': key_data,
})
- # add active mgr ip address to trusted list so dashboard can access
- trusted_ip_list = spec.trusted_ip_list if spec.trusted_ip_list else ''
- if trusted_ip_list:
- trusted_ip_list += ','
- trusted_ip_list += self.mgr.get_mgr_ip()
+ trusted_ip_list = self.get_trusted_ips(spec)
context = {
'client_name': '{}.{}'.format(utils.name_to_config_section('iscsi'), igw_id),
daemon_spec.keyring = keyring
daemon_spec.extra_files = {'iscsi-gateway.cfg': igw_conf}
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
- daemon_spec.deps = [self.mgr.get_mgr_ip()]
+ daemon_spec.deps = [trusted_ip_list]
return daemon_spec
def config_dashboard(self, daemon_descrs: List[DaemonDescription]) -> None: