]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: store oob mgmt credentials in mon kv store
authorGuillaume Abrioux <gabrioux@ibm.com>
Thu, 14 Sep 2023 15:27:45 +0000 (15:27 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 14:53:43 +0000 (14:53 +0000)
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 <gabrioux@ibm.com>
(cherry picked from commit 08e3d7ff5f70a1c6faafb64d982be6c684cfef06)

src/pybind/mgr/cephadm/module.py

index 7b97ce74a947e8cda6dbec6350aca5ef5269ac95..010aca85fa0850abbdee05806340158abcf80967 100644 (file)
@@ -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({