Merge "Allow customizing state of the python-ceph package"

This commit is contained in:
Zuul 2021-11-17 13:15:55 +00:00 committed by Gerrit Code Review
commit 6e91a0fc00
3 changed files with 23 additions and 1 deletions

View File

@ -44,6 +44,10 @@
# (optional) Ensure state of the rados python package.
# Defaults to true.
#
# [*package_ensure*]
# (optional) ensure state for package.
# Defaults to 'present'
#
class gnocchi::storage::ceph(
$ceph_username,
$ceph_keyring = $::os_service_default,
@ -51,6 +55,7 @@ class gnocchi::storage::ceph(
$ceph_pool = 'gnocchi',
$ceph_conffile = '/etc/ceph/ceph.conf',
$manage_rados = true,
$package_ensure = 'present',
) inherits gnocchi::params {
include gnocchi::deps
@ -70,7 +75,7 @@ class gnocchi::storage::ceph(
if $manage_rados {
ensure_packages('python-rados', {
'ensure' => 'present',
'ensure' => $package_ensure,
'name' => $::gnocchi::params::rados_package_name,
'tag' => ['openstack','gnocchi-package'],
})

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``gnoccho::storage::ceph::package_ensure`` parameter has been
added.

View File

@ -61,6 +61,18 @@ describe 'gnocchi::storage::ceph' do
it { is_expected.not_to contain_package('python-rados') }
end
context 'with package_ensure' do
before do
params.merge!( :package_ensure => 'latest' )
end
it { is_expected.to contain_package('python-rados').with(
:ensure => 'latest',
:name => 'python3-rados',
:tag => ['openstack', 'gnocchi-package'],
)}
end
end
on_supported_os({