From a3bd4fc557bd8b0491505950a2ddefe5d68ddf98 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 10 Oct 2016 18:01:54 +0800 Subject: [PATCH] tasks/rebuild_mondb.py: fill up the caps in the keyring we will fail 'ceph-monstore-tool' command if the caps is empty so user won't assign a key without any caps when rebuilding the monstore. Signed-off-by: Kefu Chai --- tasks/rebuild_mondb.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/rebuild_mondb.py b/tasks/rebuild_mondb.py index 8cd6ee2560c..fe70c641d7a 100644 --- a/tasks/rebuild_mondb.py +++ b/tasks/rebuild_mondb.py @@ -141,6 +141,17 @@ def task(ctx, config): default_keyring = '/etc/ceph/{cluster}.keyring'.format( cluster=cluster_name) keyring_path = config.get('keyring_path', default_keyring) + # fill up the caps in the keyring file + mon.run(args=['sudo', + 'ceph-authtool', keyring_path, + '-n', 'mon.', + '--cap', 'mon', 'allow *']) + mon.run(args=['sudo', + 'ceph-authtool', keyring_path, + '-n', 'client.admin', + '--cap', 'mon', 'allow *', + '--cap', 'osd', 'allow *', + '--cap', 'mds', 'allow *']) mon.run(args=['sudo', '-u', 'ceph', 'ceph-monstore-tool', mon_store_dir, 'rebuild', '--', '--keyring', -- 2.47.3