summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-16 22:56:55 +0000
committerGerrit Code Review <review@openstack.org>2017-06-16 22:56:55 +0000
commit1e79087b3b2fde98137a663e3766f7c55b86bc14 (patch)
tree06f43ba3fdb865dfd8e5152f74b4703c1d288170
parent4b21f69f8194a2013e5d76bb7628f3138a299b9e (diff)
parent97e89fc14741f824128ead481024d523018e5277 (diff)
Merge "Add cephfs class and deprecate cephfsnative class"
-rw-r--r--manifests/backend/cephfs.pp66
-rw-r--r--manifests/backend/cephfsnative.pp2
-rw-r--r--releasenotes/notes/deprecate-cephfsnative-add-cephfs-8ea802ec233c7618.yaml8
-rw-r--r--spec/defines/manila_backend_cephfs_spec.rb53
4 files changed, 129 insertions, 0 deletions
diff --git a/manifests/backend/cephfs.pp b/manifests/backend/cephfs.pp
new file mode 100644
index 0000000..ae98148
--- /dev/null
+++ b/manifests/backend/cephfs.pp
@@ -0,0 +1,66 @@
1# ==define manila::backend::cephfsnative
2#
3# === Parameters
4#
5# [*driver_handles_share_servers*]
6# (optional) Denotes whether the driver should handle the responsibility of
7# managing share servers. This must be set to false if the driver is to
8# operate without managing share servers.
9# Defaults to: False
10#
11# [*share_backend_name*]
12# (optional) Name of the backend in manila.conf that
13# these settings will reside in
14# Defaults to: cephfsnative
15#
16# [*cephfs_conf_path*]
17# (optional) Path to cephfs config.
18# Defaults to: $state_path/ceph.conf
19#
20# [*cephfs_auth_id*]
21# (optional) cephx user id for Manila
22# Defaults to: manila
23#
24# [*cephfs_cluster_name*]
25# (optional) Name of the cephfs cluster the driver will connect to.
26# Defaults to: ceph
27#
28# [*cephfs_enable_snapshots*]
29# (optional) If set to True, then Manila will utilize ceph snapshots.
30# Defaults to: False
31#
32# [*cephfs_ganesha_server_ip*]
33# (optional) IP of a server where Ganesha service runs on.
34# Defaults to: undef
35#
36# [*cephfs_protocol_helper_type*]
37# (optional) Sets helper type for CephFS driver, can be CEPHFS or NFS
38# Defaults to: CEPHFS
39#
40define manila::backend::cephfs (
41 $driver_handles_share_servers = false,
42 $share_backend_name = $name,
43 $cephfs_conf_path = '$state_path/ceph.conf',
44 $cephfs_auth_id = 'manila',
45 $cephfs_cluster_name = 'ceph',
46 $cephfs_enable_snapshots = false,
47 $cephfs_protocol_helper_type = 'CEPHFS',
48 $cephfs_ganesha_server_ip = undef,
49) {
50
51 include ::manila::deps
52
53 $share_driver = 'manila.share.drivers.cephfs.driver.CephFSDriver'
54
55 manila_config {
56 "${name}/driver_handles_share_servers": value => $driver_handles_share_servers;
57 "${name}/share_backend_name": value => $share_backend_name;
58 "${name}/share_driver": value => $share_driver;
59 "${name}/cephfs_conf_path": value => $cephfs_conf_path;
60 "${name}/cephfs_auth_id": value => $cephfs_auth_id;
61 "${name}/cephfs_cluster_name": value => $cephfs_cluster_name;
62 "${name}/cephfs_enable_snapshots": value => $cephfs_enable_snapshots;
63 "${name}/cephfs_protocol_helper_type": value => $cephfs_protocol_helper_type;
64 "${name}/cephfs_ganesha_server_ip": value => $cephfs_ganesha_server_ip;
65 }
66}
diff --git a/manifests/backend/cephfsnative.pp b/manifests/backend/cephfsnative.pp
index 3815113..7e5d223 100644
--- a/manifests/backend/cephfsnative.pp
+++ b/manifests/backend/cephfsnative.pp
@@ -40,6 +40,8 @@ define manila::backend::cephfsnative (
40 40
41 include ::manila::deps 41 include ::manila::deps
42 42
43 warning('manila::cephfsnative class is deprecated and will be removed in next release. You can use cephfs backend.')
44
43 $share_driver = 'manila.share.drivers.cephfs.cephfs_native.CephFSNativeDriver' 45 $share_driver = 'manila.share.drivers.cephfs.cephfs_native.CephFSNativeDriver'
44 46
45 manila_config { 47 manila_config {
diff --git a/releasenotes/notes/deprecate-cephfsnative-add-cephfs-8ea802ec233c7618.yaml b/releasenotes/notes/deprecate-cephfsnative-add-cephfs-8ea802ec233c7618.yaml
new file mode 100644
index 0000000..87ab052
--- /dev/null
+++ b/releasenotes/notes/deprecate-cephfsnative-add-cephfs-8ea802ec233c7618.yaml
@@ -0,0 +1,8 @@
1---
2features:
3 - |
4 Added new cephfs class which supports both direct cephfs access or through
5 ganesha-nfs server.
6deprecations:
7 - |
8 Deprecated cephfsnative class in favor of the new cephfs class.
diff --git a/spec/defines/manila_backend_cephfs_spec.rb b/spec/defines/manila_backend_cephfs_spec.rb
new file mode 100644
index 0000000..7693876
--- /dev/null
+++ b/spec/defines/manila_backend_cephfs_spec.rb
@@ -0,0 +1,53 @@
1require 'spec_helper'
2
3describe 'manila::backend::cephfs' do
4
5 shared_examples_for 'cephfs driver' do
6 let(:title) {'cephfs'}
7 let :params do
8 {
9 :driver_handles_share_servers => false,
10 :share_backend_name => 'cephfs',
11 :cephfs_conf_path => '$state_path/ceph.conf',
12 :cephfs_auth_id => 'manila',
13 :cephfs_cluster_name => 'ceph',
14 :cephfs_enable_snapshots => true,
15 :cephfs_protocol_helper_type => 'NFS',
16 :cephfs_ganesha_server_ip => '10.0.0.1',
17 }
18 end
19
20 it 'configures cephfs driver' do
21 is_expected.to contain_manila_config('cephfs/share_driver').with_value(
22 'manila.share.drivers.cephfs.driver.CephFSDriver')
23 is_expected.to contain_manila_config('cephfs/share_backend_name').with_value(
24 'cephfs')
25 is_expected.to contain_manila_config('cephfs/cephfs_conf_path').with_value(
26 '$state_path/ceph.conf')
27 is_expected.to contain_manila_config('cephfs/cephfs_auth_id').with_value(
28 'manila')
29 is_expected.to contain_manila_config('cephfs/cephfs_cluster_name').with_value(
30 'ceph')
31 is_expected.to contain_manila_config('cephfs/cephfs_enable_snapshots').with_value(
32 true)
33 is_expected.to contain_manila_config('cephfs/cephfs_protocol_helper_type').with_value(
34 'NFS')
35 is_expected.to contain_manila_config('cephfs/cephfs_ganesha_server_ip').with_value(
36 '10.0.0.1')
37 end
38
39 end
40
41 on_supported_os({
42 :supported_os => OSDefaults.get_supported_os
43 }).each do |os,facts|
44 context "on #{os}" do
45 let (:facts) do
46 facts.merge(OSDefaults.get_facts({ :osfamily => "#{os}" }))
47 end
48
49 it_configures 'cephfs driver'
50 end
51 end
52
53end