From: Sage Weil Date: Thu, 22 Apr 2021 12:12:49 +0000 (-0400) Subject: cephadm: distribute client.admin keyring+conf to label:_admin on bootstrap X-Git-Tag: v17.1.0~2123^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08d21ccc949aa19c08c7e806a5b58c0180f5cbe2;p=ceph.git 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 --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 15fbb4cf21e..ab1ae911827 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',