diff --git a/manifests/init.pp b/manifests/init.pp index f47683e7..348b5006 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -38,6 +38,12 @@ # [*osd_journal_size*] The size of the journal file/device. # Optional. Integer. Default provided by Ceph. # +# [*osd_max_object_name_len*] The length of the objects name +# Optional. Integer. Default to undef +# +# [*osd_max_object_namespace_len*] The length of the objects namespace name +# Optional. Integer. Default to undef +# # [*osd_pool_default_pg_num*] The default number of PGs per pool. # Optional. Integer. Default provided by Ceph. # @@ -135,6 +141,8 @@ class ceph ( $authentication_type = 'cephx', $keyring = undef, $osd_journal_size = undef, + $osd_max_object_name_len = undef, + $osd_max_object_namespace_len = undef, $osd_pool_default_pg_num = undef, $osd_pool_default_pgp_num = undef, $osd_pool_default_size = undef, @@ -178,27 +186,42 @@ class ceph ( Package<| tag == 'ceph' |> -> Ceph_config<| |> # [global] ceph_config { - 'global/fsid': value => $fsid; - 'global/keyring': value => $keyring; - 'global/osd_pool_default_pg_num': value => $osd_pool_default_pg_num; - 'global/osd_pool_default_pgp_num': value => $osd_pool_default_pgp_num; - 'global/osd_pool_default_size': value => $osd_pool_default_size; - 'global/osd_pool_default_min_size': value => $osd_pool_default_min_size; - 'global/osd_pool_default_crush_rule': value => $osd_pool_default_crush_rule; - 'global/osd_crush_update_on_start': value => $osd_crush_update_on_start; - 'global/mon_osd_full_ratio': value => $mon_osd_full_ratio; - 'global/mon_osd_nearfull_ratio': value => $mon_osd_nearfull_ratio; - 'global/mon_initial_members': value => $mon_initial_members; - 'global/mon_host': value => $mon_host; - 'global/ms_bind_ipv6': value => $ms_bind_ipv6; - 'global/require_signatures': value => $require_signatures; - 'global/cluster_require_signatures': value => $cluster_require_signatures; - 'global/service_require_signatures': value => $service_require_signatures; - 'global/sign_messages': value => $sign_messages; - 'global/cluster_network': value => $cluster_network; - 'global/public_network': value => $public_network; - 'global/public_addr': value => $public_addr; - 'osd/osd_journal_size': value => $osd_journal_size; + 'global/fsid': value => $fsid; + 'global/keyring': value => $keyring; + 'global/osd_pool_default_pg_num': value => $osd_pool_default_pg_num; + 'global/osd_pool_default_pgp_num': value => $osd_pool_default_pgp_num; + 'global/osd_pool_default_size': value => $osd_pool_default_size; + 'global/osd_pool_default_min_size': value => $osd_pool_default_min_size; + 'global/osd_pool_default_crush_rule': value => $osd_pool_default_crush_rule; + 'global/osd_crush_update_on_start': value => $osd_crush_update_on_start; + 'global/mon_osd_full_ratio': value => $mon_osd_full_ratio; + 'global/mon_osd_nearfull_ratio': value => $mon_osd_nearfull_ratio; + 'global/mon_initial_members': value => $mon_initial_members; + 'global/mon_host': value => $mon_host; + 'global/ms_bind_ipv6': value => $ms_bind_ipv6; + 'global/require_signatures': value => $require_signatures; + 'global/cluster_require_signatures': value => $cluster_require_signatures; + 'global/service_require_signatures': value => $service_require_signatures; + 'global/sign_messages': value => $sign_messages; + 'global/cluster_network': value => $cluster_network; + 'global/public_network': value => $public_network; + 'global/public_addr': value => $public_addr; + 'osd/osd_journal_size': value => $osd_journal_size; + } + + + # NOTE(aschultz): for backwards compatibility in p-o-i & elsewhere we only + # define these here if they are set. Once this patch lands, we can update + # p-o-i to leverage these parameters and ditch these if clauses. + if $osd_max_object_name_len { + ceph_config { + 'global/osd_max_object_name_len': value => $osd_max_object_name_len; + } + } + if $osd_max_object_namespace_len { + ceph_config { + 'global/osd_max_object_namespace_len': value => $osd_max_object_namespace_len; + } } if $authentication_type == 'cephx' { diff --git a/manifests/profile/base.pp b/manifests/profile/base.pp index 8d0e91fe..4821da83 100644 --- a/manifests/profile/base.pp +++ b/manifests/profile/base.pp @@ -34,6 +34,8 @@ class ceph::profile::base { fsid => $ceph::profile::params::fsid, authentication_type => $ceph::profile::params::authentication_type, osd_journal_size => $ceph::profile::params::osd_journal_size, + osd_max_object_name_len => $ceph::profile::params::osd_max_object_name_len, + osd_max_object_namespace_len => $ceph::profile::params::osd_max_object_namespace_len, osd_pool_default_pg_num => $ceph::profile::params::osd_pool_default_pg_num, osd_pool_default_pgp_num => $ceph::profile::params::osd_pool_default_pgp_num, osd_pool_default_size => $ceph::profile::params::osd_pool_default_size, diff --git a/manifests/profile/params.pp b/manifests/profile/params.pp index f2486549..570a55b6 100644 --- a/manifests/profile/params.pp +++ b/manifests/profile/params.pp @@ -44,6 +44,12 @@ # [*osd_journal_size*] The size of the journal file/device. # Optional. Integer. Default provided by Ceph. # +# [*osd_max_object_name_len*] The maximum length of a rados object name +# Optional. Integer. Default to undef. +# +# [*osd_max_object_namespace_len*] The maximum length of a rados object name +# Optional. Integer. Default to undef. +# # [*osd_pool_default_pg_num*] The default number of PGs per pool. # Optional. Integer. Default provided by Ceph. # @@ -148,6 +154,8 @@ class ceph::profile::params ( $mon_host = undef, $ms_bind_ipv6 = undef, $osd_journal_size = undef, + $osd_max_object_name_len = undef, + $osd_max_object_namespace_len = undef, $osd_pool_default_pg_num = undef, $osd_pool_default_pgp_num = undef, $osd_pool_default_size = undef, diff --git a/spec/acceptance/ceph_mon_osd_spec.rb b/spec/acceptance/ceph_mon_osd_spec.rb index 8a9e778c..d31ff708 100644 --- a/spec/acceptance/ceph_mon_osd_spec.rb +++ b/spec/acceptance/ceph_mon_osd_spec.rb @@ -29,16 +29,16 @@ describe 'ceph mon osd' do enable_epel => false, } class { 'ceph': - fsid => '82274746-9a2c-426b-8c51-107fb0d890c6', - mon_host => $::ipaddress, - authentication_type => 'none', - osd_pool_default_size => '1', - osd_pool_default_min_size => '1', + fsid => '82274746-9a2c-426b-8c51-107fb0d890c6', + mon_host => $::ipaddress, + authentication_type => 'none', + osd_pool_default_size => '1', + osd_pool_default_min_size => '1', + osd_max_object_namespace_len => '64', + osd_max_object_name_len => '256', } ceph_config { 'global/osd_journal_size': value => '100'; - 'global/osd_max_object_namespace_len': value => '64'; - 'global/osd_max_object_name_len': value => '256'; } ceph::mon { 'a': public_addr => $::ipaddress, diff --git a/spec/classes/ceph_init_spec.rb b/spec/classes/ceph_init_spec.rb index bc12a71c..c4942ab5 100644 --- a/spec/classes/ceph_init_spec.rb +++ b/spec/classes/ceph_init_spec.rb @@ -68,6 +68,8 @@ describe 'ceph' do :authentication_type => 'none', :keyring => '/usr/local/ceph/etc/keyring', :osd_journal_size => '1024', + :osd_max_object_name_len => '1024', + :osd_max_object_namespace_len => '256', :osd_pool_default_pg_num => '256', :osd_pool_default_pgp_num => '256', :osd_pool_default_size => '2', @@ -102,6 +104,8 @@ describe 'ceph' do it { is_expected.to contain_ceph_config('global/fsid').with_value('d5252e7d-75bc-4083-85ed-fe51fa83f62b') } it { is_expected.to contain_ceph_config('global/keyring').with_value('/usr/local/ceph/etc/keyring') } + it { is_expected.to contain_ceph_config('global/osd_max_object_name_len').with_value('1024') } + it { is_expected.to contain_ceph_config('global/osd_max_object_namespace_len').with_value('256') } it { is_expected.to contain_ceph_config('global/osd_pool_default_pg_num').with_value('256') } it { is_expected.to contain_ceph_config('global/osd_pool_default_pgp_num').with_value('256') } it { is_expected.to contain_ceph_config('global/osd_pool_default_size').with_value('2') } diff --git a/spec/fixtures/hieradata/common.yaml b/spec/fixtures/hieradata/common.yaml index 47ff4c4c..f436f668 100644 --- a/spec/fixtures/hieradata/common.yaml +++ b/spec/fixtures/hieradata/common.yaml @@ -8,6 +8,8 @@ ceph::profile::params::authentication_type: 'cephx' ceph::profile::params::mon_initial_members: 'first, second' ceph::profile::params::mon_host: '10.11.12.2:6789, 10.11.12.3:6789' ceph::profile::params::osd_journal_size: '4096' +ceph::profile::params::osd_max_object_name_len: '256' +ceph::profile::params::osd_max_object_namespace_len: '64' ceph::profile::params::osd_pool_default_pg_num: '200' ceph::profile::params::osd_pool_default_pgp_num: '200' ceph::profile::params::osd_pool_default_size: '2'