From: Sage Weil Date: Fri, 27 Mar 2020 15:39:09 +0000 (-0500) Subject: qa/tasks/cephadm: distribute ceph.conf and admin keyring to all nodes X-Git-Tag: v16.1.0~2745^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c78dfe26fd0ec80a517d200f4685b216272f682;p=ceph.git qa/tasks/cephadm: distribute ceph.conf and admin keyring to all nodes Revert part of 96220c0c0574eb5b896023e1552f528bef9e1ca5 so that we still distribute a *final* ceph.conf and admin keyring to all nodes, right after all of the mons are up. Signed-off-by: Sage Weil --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 7b3144717981..afd69911eb87 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -931,6 +931,31 @@ def restart(ctx, config): ctx.managers[cluster].wait_for_all_osds_up() yield +@contextlib.contextmanager +def distribute_config_and_admin_keyring(ctx, config): + """ + Distribute a sufficient config and keyring for clients + """ + cluster_name = config['cluster'] + log.info('Distributing (final) config and client.admin keyring...') + for remote, roles in ctx.cluster.remotes.items(): + teuthology.sudo_write_file( + remote=remote, + path='/etc/ceph/{}.conf'.format(cluster_name), + data=ctx.ceph[cluster_name].config_file) + teuthology.sudo_write_file( + remote=remote, + path='/etc/ceph/{}.client.admin.keyring'.format(cluster_name), + data=ctx.ceph[cluster_name].admin_keyring) + try: + yield + finally: + ctx.cluster.run(args=[ + 'sudo', 'rm', '-f', + '/etc/ceph/{}.conf'.format(cluster_name), + '/etc/ceph/{}.client.admin.keyring'.format(cluster_name), + ]) + @contextlib.contextmanager def crush_setup(ctx, config): cluster_name = config['cluster'] @@ -1028,6 +1053,7 @@ def task(ctx, config): lambda: ceph_bootstrap(ctx=ctx, config=config), lambda: crush_setup(ctx=ctx, config=config), lambda: ceph_mons(ctx=ctx, config=config), + lambda: distribute_config_and_admin_keyring(ctx=ctx, config=config), lambda: ceph_mgrs(ctx=ctx, config=config), lambda: ceph_osds(ctx=ctx, config=config), lambda: ceph_mdss(ctx=ctx, config=config),