]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: remember log destination used during bootstrap
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 6 Sep 2023 18:15:41 +0000 (14:15 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 19 Sep 2023 20:17:24 +0000 (16:17 -0400)
Store the log destination(s) specified on the CLI for cephadm bootstrap
as the manager configuration, unless the configuration key is explicitly
set by the input config.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index 5d14ea773eca61e80bc0dc5be4f5bdfcac626396..50a1a4c27ae0603c5d2613c84ad5a4311ca79da0 100755 (executable)
@@ -5664,6 +5664,16 @@ def command_bootstrap(ctx):
                  '-i', '/var/lib/ceph/user.conf'],
                 {tmp.name: '/var/lib/ceph/user.conf:z'})
 
+    if getattr(ctx, 'log_dest', None):
+        ldkey = 'mgr/cephadm/cephadm_log_destination'
+        cp = read_config(ctx.config)
+        if cp.has_option('mgr', ldkey):
+            logger.info('The cephadm log destination is set by the config file, ignoring cli option')
+        else:
+            value = ','.join(sorted(getattr(ctx, 'log_dest')))
+            logger.info('Setting cephadm log destination to match logging for cephadm boostrap: %s', value)
+            cli(['config', 'set', 'mgr', ldkey, value, '--force'])
+
     # wait for mgr to restart (after enabling a module)
     def wait_for_mgr_restart() -> None:
         # first get latest mgrmap epoch from the mon.  try newer 'mgr