[pve-devel] [PATCH manager] ceph: init: only handle keyring if auth is cephx

Dominik Csapak d.csapak at proxmox.com
Wed Jul 3 09:45:35 CEST 2019


if auth is 'none' there is no client keyring, so do not generate it and
do not write it into the config

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 1ce74378..1036e24c 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -331,7 +331,9 @@ __PACKAGE__->register_method ({
 		#'osd pool default pgp num' => $pg_num,
 	    }
 
-	    $cfg->{client}->{keyring} = '/etc/pve/priv/$cluster.$name.keyring';
+	    if ($auth eq 'cephx') {
+		$cfg->{client}->{keyring} = '/etc/pve/priv/$cluster.$name.keyring';
+	    }
 
 	    if ($param->{pg_bits}) {
 		$cfg->{global}->{'osd pg bits'} = $param->{pg_bits};
@@ -349,7 +351,9 @@ __PACKAGE__->register_method ({
 
 	    cfs_write_file('ceph.conf', $cfg);
 
-	    PVE::Ceph::Tools::get_or_create_admin_keyring();
+	    if ($auth eq 'cephx') {
+		PVE::Ceph::Tools::get_or_create_admin_keyring();
+	    }
 	    PVE::Ceph::Tools::setup_pve_symlinks();
 	});
 
-- 
2.20.1





More information about the pve-devel mailing list