init: allow to configure rbd_default_features

Allow puppet-ceph to configure rbd_default_features parameter in
ceph.conf / [client] section. Operators deploying newer Ceph clients
that must use older Ceph servers need to be able to easily set this
option for backwards compatibility.

Depends-On: I3242cfe0f141fe2bbb951ce2cf7071fd07456db8
Change-Id: I477640c5db2cc84622da7734fb54cfe7740bd137
Partial-Bug: 1633552
This commit is contained in:
John Fulton 2016-10-15 16:30:56 -04:00
parent 28e8f4525f
commit 8e01a41431
4 changed files with 14 additions and 3 deletions

View File

@ -128,6 +128,9 @@
# Set to 0 to disable it.
# Optional. Default provided by Ceph
#
# [*rbd_default_features*] Set RBD features configuration.
# Optional. String. Defaults to undef.
#
# DEPRECATED PARAMETERS
#
# [*set_osd_params*] disables setting osd params using this module by default as people
@ -167,6 +170,7 @@ class ceph (
$osd_recovery_max_single_start = undef,
$osd_max_scrubs = undef,
$osd_op_threads = undef,
$rbd_default_features = undef,
# DEPRECATED PARAMETERS
$set_osd_params = false,
) {
@ -208,6 +212,7 @@ this module to assign values and will be removed in a future release.')
'global/public_network': value => $public_network;
'global/public_addr': value => $public_addr;
'osd/osd_journal_size': value => $osd_journal_size;
'client/rbd_default_features': value => $rbd_default_features;
}

View File

@ -51,5 +51,6 @@ class ceph::profile::base {
osd_recovery_max_single_start => $ceph::profile::params::osd_recovery_max_single_start,
osd_max_scrubs => $ceph::profile::params::osd_max_scrubs,
osd_op_threads => $ceph::profile::params::osd_op_threads,
rbd_default_features => $ceph::profile::params::rbd_default_features,
}
}

View File

@ -172,7 +172,7 @@
#
# [*rgw_keystone_admin_password*] The password for OpenStack admin user
# Required if is 'v3'.
#
#
# [*rbd_mirror_client_name*] Name of the cephx client key used for rbd mirroring
# Optional. Default is undef
#
@ -185,7 +185,9 @@
# [*fs_data_pool*] The FS data pool name.
# Optional but required when using fs.
#
# [*rbd_default_features*] Set RBD features configuration.
# Optional. String. Defaults to undef.
#
class ceph::profile::params (
$fsid = undef,
@ -232,7 +234,7 @@ class ceph::profile::params (
$fs_metadata_pool = undef,
$fs_data_pool = undef,
$fs_name = undef,
$rbd_default_features = undef,
) {
validate_hash($client_keys)

View File

@ -51,6 +51,7 @@ describe 'ceph' do
it { is_expected.to_not contain_ceph_config('global/public_network').with_value('192.168.0.0/24') }
it { is_expected.to_not contain_ceph_config('global/public_addr').with_value('192.168.0.2') }
it { is_expected.to_not contain_ceph_config('osd/osd_journal_size').with_value('4096') }
it { is_expected.to_not contain_ceph_config('client/rbd_default_features').with_value('15') }
it { is_expected.to contain_ceph_config('global/auth_cluster_required').with_value('cephx') }
it { is_expected.to contain_ceph_config('global/auth_service_required').with_value('cephx') }
it { is_expected.to contain_ceph_config('global/auth_client_required').with_value('cephx') }
@ -95,6 +96,7 @@ describe 'ceph' do
:osd_recovery_max_single_start => '1',
:osd_max_scrubs => '1',
:osd_op_threads => '2',
:rbd_default_features => '12',
}
end
@ -125,6 +127,7 @@ describe 'ceph' do
it { is_expected.to contain_ceph_config('global/public_network').with_value('192.168.0.0/24') }
it { is_expected.to contain_ceph_config('global/public_addr').with_value('192.168.0.2') }
it { is_expected.to contain_ceph_config('osd/osd_journal_size').with_value('1024') }
it { is_expected.to contain_ceph_config('client/rbd_default_features').with_value('12') }
it { is_expected.to_not contain_ceph_config('global/auth_cluster_required').with_value('cephx') }
it { is_expected.to_not contain_ceph_config('global/auth_service_required').with_value('cephx') }
it { is_expected.to_not contain_ceph_config('global/auth_client_required').with_value('cephx') }