From: Kefu Chai Date: Mon, 10 Oct 2016 10:01:54 +0000 (+0800) Subject: tasks/rebuild_mondb.py: fill up the caps in the keyring X-Git-Tag: v11.1.1~58^2^2~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a3bd4fc557bd8b0491505950a2ddefe5d68ddf98;p=ceph.git 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 --- diff --git a/tasks/rebuild_mondb.py b/tasks/rebuild_mondb.py index 8cd6ee2560ca..fe70c641d7aa 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',