]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/rebuild_mondb.py: fill up the caps in the keyring
authorKefu Chai <kchai@redhat.com>
Mon, 10 Oct 2016 10:01:54 +0000 (18:01 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 10 Oct 2016 10:02:33 +0000 (18:02 +0800)
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 <kchai@redhat.com>
tasks/rebuild_mondb.py

index 8cd6ee2560ca736b664efa828e8c7abf393dc984..fe70c641d7aa07661627ebf79779cc0438062225 100644 (file)
@@ -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',