diff --git a/manifests/backend/rbd.pp b/manifests/backend/rbd.pp index ddbd58b6..8cadb987 100644 --- a/manifests/backend/rbd.pp +++ b/manifests/backend/rbd.pp @@ -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) } diff --git a/releasenotes/notes/add-manage_package-to-rbd-backend-ce4239485895cbd1.yaml b/releasenotes/notes/add-manage_package-to-rbd-backend-ce4239485895cbd1.yaml new file mode 100644 index 00000000..bfbab115 --- /dev/null +++ b/releasenotes/notes/add-manage_package-to-rbd-backend-ce4239485895cbd1.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added ``manage_package`` parameter to RBD backend to not install ceph-common + if set to false. (Default: true) diff --git a/spec/defines/cinder_backend_rbd_spec.rb b/spec/defines/cinder_backend_rbd_spec.rb index 42fec77f..f900ecdf 100644 --- a/spec/defines/cinder_backend_rbd_spec.rb +++ b/spec/defines/cinder_backend_rbd_spec.rb @@ -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