Add manage_package to RBD backend

Ability to not manage the ceph-common package by setting
this to false (Default: true)

Change-Id: I1f51d9ed3f4862f2c0e357cb86e7469333c2c208
This commit is contained in:
Sam Morrison 2024-05-28 13:53:59 +10:00 committed by Takashi Kajinami
parent 4c8f765f48
commit 9055ae436a
3 changed files with 25 additions and 4 deletions

View File

@ -107,6 +107,10 @@
# with volume_backend_name=$volume_backend_name key/value.
# Defaults to false.
#
# [*manage_package*]
# (optional) Ensures ceph client package is installed if true.
# Defaults to: true
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
@ -136,6 +140,7 @@ define cinder::backend::rbd (
$deferred_deletion_purge_interval = $facts['os_service_default'],
$rbd_concurrent_flatten_operations = $facts['os_service_default'],
Boolean $manage_volume_type = false,
Boolean $manage_package = true,
Hash $extra_options = {},
) {
@ -190,10 +195,12 @@ define cinder::backend::rbd (
}
}
ensure_packages( 'ceph-common', {
ensure => present,
name => $::cinder::params::ceph_common_package_name,
tag => 'cinder-support-package'})
if $manage_package {
ensure_packages( 'ceph-common', {
ensure => present,
name => $::cinder::params::ceph_common_package_name,
tag => 'cinder-support-package'})
}
create_resources('cinder_config', $extra_options)
}

View File

@ -0,0 +1,5 @@
---
features:
- |
Added ``manage_package`` parameter to RBD backend to not install ceph-common
if set to false. (Default: true)

View File

@ -136,6 +136,15 @@ describe 'cinder::backend::rbd' do
:properties => ['volume_backend_name=rbd-ssd']
)}
end
context 'rbd backend without managing package' do
before do
params.merge!( :manage_package => false )
end
it {
is_expected.to_not contain_package('ceph-common')
}
end
end
end