From 9055ae436ae909493654b0177d3358c7a16e6b47 Mon Sep 17 00:00:00 2001 From: Sam Morrison Date: Tue, 28 May 2024 13:53:59 +1000 Subject: [PATCH] Add manage_package to RBD backend Ability to not manage the ceph-common package by setting this to false (Default: true) Change-Id: I1f51d9ed3f4862f2c0e357cb86e7469333c2c208 --- manifests/backend/rbd.pp | 15 +++++++++++---- ...e_package-to-rbd-backend-ce4239485895cbd1.yaml | 5 +++++ spec/defines/cinder_backend_rbd_spec.rb | 9 +++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/add-manage_package-to-rbd-backend-ce4239485895cbd1.yaml 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