Add parameters necessary to use a remote Ganesha service

The CephFS backend can use SSH to configure Ganesha even when this
is deployed on remote servers. This change adds the parameters
necessary to configure Manila with the appropriate credentials to
connect via SSH to the remote server.

Change-Id: I31fff6a1b6fede860b8aaee0079183924e8b31d6
(cherry picked from commit 80a8df6593)
This commit is contained in:
Giulio Fidente 2019-05-24 14:41:12 +02:00
parent f969ee6055
commit b0732d7b11
3 changed files with 72 additions and 28 deletions

View File

@ -33,6 +33,26 @@
# (optional) IP of a server where Ganesha service runs on.
# Defaults to: undef
#
# [*cephfs_ganesha_server_is_remote*]
# (required) Whether the Ganesha service is remote or colocated on the
# same node where the Share service runs.
# Defaults to $::os_service_default
#
# [*cephfs_ganesha_server_username*]
# (optional) The username to use when logging on the remote node
# hosting the Ganesha service
# Defaults to: undef
#
# [*cephfs_ganesha_server_password*]
# (optional) The password to use when logging on the remote node
# hosting the Ganesha service
# Defaults to: undef
#
# [*cephfs_ganesha_path_to_private_key*]
# (optional) The secret key to use when logging on the remote node
# hosting the Ganesha service (preveals on server_password)
# Defaults to: undef
#
# [*cephfs_volume_mode*]
# (optional) octal rwx permissions for CephFS backing volumes,
# snapshots, and groups of volumes and snapshots.
@ -43,15 +63,19 @@
# Defaults to: CEPHFS
#
define manila::backend::cephfs (
$driver_handles_share_servers = false,
$share_backend_name = $name,
$cephfs_conf_path = '$state_path/ceph.conf',
$cephfs_auth_id = 'manila',
$cephfs_cluster_name = 'ceph',
$cephfs_enable_snapshots = false,
$cephfs_ganesha_server_ip = undef,
$cephfs_volume_mode = $::os_service_default,
$cephfs_protocol_helper_type = 'CEPHFS',
$driver_handles_share_servers = false,
$share_backend_name = $name,
$cephfs_conf_path = '$state_path/ceph.conf',
$cephfs_auth_id = 'manila',
$cephfs_cluster_name = 'ceph',
$cephfs_enable_snapshots = false,
$cephfs_ganesha_server_ip = undef,
$cephfs_ganesha_server_is_remote = $::os_service_default,
$cephfs_ganesha_server_username = undef,
$cephfs_ganesha_server_password = undef,
$cephfs_ganesha_path_to_private_key = undef,
$cephfs_volume_mode = $::os_service_default,
$cephfs_protocol_helper_type = 'CEPHFS',
) {
include ::manila::deps
@ -59,15 +83,19 @@ define manila::backend::cephfs (
$share_driver = 'manila.share.drivers.cephfs.driver.CephFSDriver'
manila_config {
"${name}/driver_handles_share_servers": value => $driver_handles_share_servers;
"${name}/share_backend_name": value => $share_backend_name;
"${name}/share_driver": value => $share_driver;
"${name}/cephfs_conf_path": value => $cephfs_conf_path;
"${name}/cephfs_auth_id": value => $cephfs_auth_id;
"${name}/cephfs_cluster_name": value => $cephfs_cluster_name;
"${name}/cephfs_enable_snapshots": value => $cephfs_enable_snapshots;
"${name}/cephfs_ganesha_server_ip": value => $cephfs_ganesha_server_ip;
"${name}/cephfs_volume_mode": value => $cephfs_volume_mode;
"${name}/driver_handles_share_servers": value => $driver_handles_share_servers;
"${name}/share_backend_name": value => $share_backend_name;
"${name}/share_driver": value => $share_driver;
"${name}/cephfs_conf_path": value => $cephfs_conf_path;
"${name}/cephfs_auth_id": value => $cephfs_auth_id;
"${name}/cephfs_cluster_name": value => $cephfs_cluster_name;
"${name}/cephfs_enable_snapshots": value => $cephfs_enable_snapshots;
"${name}/cephfs_ganesha_server_ip": value => $cephfs_ganesha_server_ip;
"${name}/cephfs_ganesha_server_is_remote": value => $cephfs_ganesha_server_is_remote;
"${name}/cephfs_ganesha_server_username": value => $cephfs_ganesha_server_username;
"${name}/cephfs_ganesha_server_password": value => $cephfs_ganesha_server_password;
"${name}/cephfs_ganesha_path_to_private_key": value => $cephfs_ganesha_path_to_private_key;
"${name}/cephfs_volume_mode": value => $cephfs_volume_mode;
"${name}/cephfs_protocol_helper_type": value => $cephfs_protocol_helper_type;
}
}

View File

@ -0,0 +1,7 @@
---
features:
- |
New parameters are added to the cephfs backend to permit
configuration with an external Ganesha service; the new
parameters define if Ganesha is remote and what are the
username/password or private key to log on the remote host.

View File

@ -6,15 +6,18 @@ describe 'manila::backend::cephfs' do
let(:title) {'cephfs'}
let :params do
{
:driver_handles_share_servers => false,
:share_backend_name => 'cephfs',
:cephfs_conf_path => '$state_path/ceph.conf',
:cephfs_auth_id => 'manila',
:cephfs_cluster_name => 'ceph',
:cephfs_enable_snapshots => true,
:cephfs_protocol_helper_type => 'NFS',
:cephfs_ganesha_server_ip => '10.0.0.1',
:cephfs_volume_mode => '0775'
:driver_handles_share_servers => false,
:share_backend_name => 'cephfs',
:cephfs_conf_path => '$state_path/ceph.conf',
:cephfs_auth_id => 'manila',
:cephfs_cluster_name => 'ceph',
:cephfs_enable_snapshots => true,
:cephfs_protocol_helper_type => 'NFS',
:cephfs_ganesha_server_ip => '10.0.0.1',
:cephfs_ganesha_server_is_remote => true,
:cephfs_ganesha_server_username => 'ganeshadmin',
:cephfs_ganesha_path_to_private_key => '/readable/by/manila.key',
:cephfs_volume_mode => '0775'
}
end
@ -36,7 +39,13 @@ describe 'manila::backend::cephfs' do
is_expected.to contain_manila_config('cephfs/cephfs_ganesha_server_ip').with_value(
'10.0.0.1')
is_expected.to contain_manila_config('cephfs/cephfs_volume_mode').with_value(
'0775'
'0775')
is_expected.to contain_manila_config('cephfs/cephfs_ganesha_server_is_remote').with_value(
true)
is_expected.to contain_manila_config('cephfs/cephfs_ganesha_server_username').with_value(
'ganeshadmin')
is_expected.to contain_manila_config('cephfs/cephfs_ganesha_path_to_private_key').with_value(
'/readable/by/manila.key'
)
end