From 08d21ccc949aa19c08c7e806a5b58c0180f5cbe2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Apr 2021 08:12:49 -0400 Subject: [PATCH] cephadm: distribute client.admin keyring+conf to label:_admin on bootstrap If we are placing ceph.conf in /etc/ceph (the default), tell the cluster to continue doing this going forward to hosts with the '_admin' label. This doesn't induce the user to add the admin label to other hosts too, unfortunately--e probably want them to add the admin label to other mons, for instance--but it is a start. Signed-off-by: Sage Weil --- src/cephadm/cephadm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 15fbb4cf21eea..ab1ae911827df 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -4128,6 +4128,14 @@ def command_bootstrap(ctx): if not ctx.skip_dashboard: prepare_dashboard(ctx, uid, gid, cli, wait_for_mgr_restart) + if ctx.output_config == '/etc/ceph/ceph.conf' and not ctx.skip_admin_label: + logger.info('Enabling client.admin keyring and conf on hosts with "admin" label') + try: + cli(['orch', 'client-keyring', 'set', 'client.admin', 'label:_admin']) + cli(['orch', 'host', 'label', 'add', get_hostname(), '_admin']) + except Exception: + logger.info('Unable to set up "admin" label; assuming older version of Ceph') + if ctx.apply_spec: logger.info('Applying %s to cluster' % ctx.apply_spec) @@ -7665,6 +7673,10 @@ def _get_parser(): parser_bootstrap.add_argument( '--output-pub-ssh-key', help="location to write the cluster's public SSH key") + parser_bootstrap.add_argument( + '--skip-admin-label', + action='store_true', + help='do not create admin label for ceph.conf and client.admin keyring distribution') parser_bootstrap.add_argument( '--skip-ssh', action='store_true', -- 2.39.5