Update glance::backend::rbd options
This patch is aim to add rbd options in glance-api.conf and also update related spec test. Fixes bug #1221074 Change-Id: Ifcbaf15ab4a7aedb074abac42941181e53d538c4
This commit is contained in:
@@ -4,19 +4,26 @@
|
|||||||
#
|
#
|
||||||
# $rbd_store_user - Optional.
|
# $rbd_store_user - Optional.
|
||||||
#
|
#
|
||||||
# $rbd_store_pool - Optional. Default:'images',
|
# $rbd_store_pool - Optional. Default:'images'
|
||||||
#
|
#
|
||||||
|
# $rbd_store_ceph_conf - Optional. Default:'/etc/ceph/ceph.conf'
|
||||||
|
#
|
||||||
|
# $rbd_store_chunk_size - Optional. Default:'8'
|
||||||
|
|
||||||
class glance::backend::rbd(
|
class glance::backend::rbd(
|
||||||
$rbd_store_user = undef,
|
$rbd_store_user = undef,
|
||||||
$rbd_store_pool = 'images',
|
$rbd_store_ceph_conf = '/etc/ceph/ceph.conf',
|
||||||
|
$rbd_store_pool = 'images',
|
||||||
|
$rbd_store_chunk_size = '8',
|
||||||
) {
|
) {
|
||||||
include glance::params
|
include glance::params
|
||||||
|
|
||||||
glance_api_config {
|
glance_api_config {
|
||||||
'DEFAULT/default_store': value => 'rbd';
|
'DEFAULT/default_store': value => 'rbd';
|
||||||
'DEFAULT/rbd_store_user': value => $rbd_store_user;
|
'DEFAULT/rbd_store_ceph_conf': value => $rbd_store_ceph_conf;
|
||||||
'DEFAULT/rbd_store_pool': value => $rbd_store_pool;
|
'DEFAULT/rbd_store_user': value => $rbd_store_user;
|
||||||
|
'DEFAULT/rbd_store_pool': value => $rbd_store_pool;
|
||||||
|
'DEFAULT/rbd_store_chunk_size': value => $rbd_store_chunk_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'python-ceph':
|
package { 'python-ceph':
|
||||||
|
@@ -9,13 +9,14 @@ describe 'glance::backend::rbd' do
|
|||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:rbd_store_user => 'user',
|
:rbd_store_user => 'glance',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_glance_api_config('DEFAULT/default_store').with_value('rbd') }
|
it { should contain_glance_api_config('DEFAULT/default_store').with_value('rbd') }
|
||||||
it { should contain_glance_api_config('DEFAULT/rbd_store_user').with_value('user') }
|
|
||||||
it { should contain_glance_api_config('DEFAULT/rbd_store_pool').with_value('images') }
|
it { should contain_glance_api_config('DEFAULT/rbd_store_pool').with_value('images') }
|
||||||
|
it { should contain_glance_api_config('DEFAULT/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') }
|
||||||
|
it { should contain_glance_api_config('DEFAULT/rbd_store_chunk_size').with_value('8') }
|
||||||
|
|
||||||
it { should contain_package('python-ceph').with(
|
it { should contain_package('python-ceph').with(
|
||||||
:name => 'python-ceph',
|
:name => 'python-ceph',
|
||||||
@@ -23,4 +24,14 @@ describe 'glance::backend::rbd' do
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
describe 'when passing params' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:rbd_store_user => 'user',
|
||||||
|
:rbd_store_chunk_size => '2',
|
||||||
|
}
|
||||||
|
it { should contain_glance_api_config('DEFAULT/rbd_store_user').with_value('user') }
|
||||||
|
it { should contain_glance_api_config('DEFAULT/rbd_store_chunk_size').with_value('2') }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user