From 6e0359ec3648b57c6bbe8d880230bb2396dab3ea Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 14 Sep 2023 15:27:45 +0000 Subject: [PATCH] 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 (cherry picked from commit 08e3d7ff5f70a1c6faafb64d982be6c684cfef06) --- src/pybind/mgr/cephadm/module.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 7b97ce74a947e..010aca85fa085 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1597,6 +1597,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({ -- 2.39.5