From: Guillaume Abrioux Date: Thu, 14 Sep 2023 15:27:45 +0000 (+0000) Subject: mgr/cephadm: store oob mgmt credentials in mon kv store X-Git-Tag: v19.3.0~102^2~70 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08e3d7ff5f70a1c6faafb64d982be6c684cfef06;p=ceph.git mgr/cephadm: store oob mgmt credentials in mon kv store The idea is to store the oob mgmt credentials into the monitor kv store when they are passed via a host spec. Signed-off-by: Guillaume Abrioux --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b8f9d648ed4f..8c1e3a482847 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1613,6 +1613,19 @@ Then run the following: if spec.hostname in self.inventory and self.inventory.get_addr(spec.hostname) != spec.addr: self.cache.refresh_all_host_info(spec.hostname) + if spec.idrac: + if not spec.idrac.get('addr'): + spec.idrac['addr'] = spec.hostname + if not spec.idrac.get('port'): + spec.idrac['port'] = '443' + data = json.loads(self.get_store('node_proxy/idrac', '{}')) + data[spec.hostname] = dict() + data[spec.hostname]['addr'] = spec.idrac['addr'] + data[spec.hostname]['port'] = spec.idrac['port'] + data[spec.hostname]['username'] = spec.idrac['username'] + data[spec.hostname]['password'] = spec.idrac['password'] + self.set_store('node_proxy/idrac', json.dumps(data)) + # prime crush map? if spec.location: self.check_mon_command({