if for some reason the cluster does not have this key, generate it

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 PVE/API2/Ceph/OSD.pm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index 064f6b03..85197107 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -313,7 +313,14 @@ __PACKAGE__->register_method ({
        my $ceph_bootstrap_osd_keyring = 
PVE::Ceph::Tools::get_config('ceph_bootstrap_osd_keyring');
 
        if (! -f $ceph_bootstrap_osd_keyring && 
$ceph_conf->{global}->{auth_client_required} eq 'cephx') {
-           my $bindata = $rados->mon_command({ prefix => 'auth get', entity => 
'client.bootstrap-osd', format => 'plain' });
+           my $bindata = $rados->mon_command({
+                   prefix => 'auth get-or-create',
+                   entity => 'client.bootstrap-osd',
+                   caps => [
+                       'mon' => 'allow profile bootstrap-osd'
+                   ],
+                   format => 'plain',
+               });
            file_set_contents($ceph_bootstrap_osd_keyring, $bindata);
        };
 
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to