Browse Source

Deprecated manage_cradox and set manage_rados to true

The [1] commit changed the ordering in Gnocchi so that
the rados library is preferred over cradox that is no
longer maintained and hasn't been updated in a long time.

Cradox is no longer tested in upstream Gnocchi and support
was removed in [2] which is not yet released.

This patch also changes the default value for manage_rados
to true so that it's manage by default since it's the one
preferred.

[1] d5a782e58f (diff-60cbc467d17fe0479d5cb2292f716fd73b200973ae43889f72c51227d311a785)
[2] bf37e90eda (diff-60cbc467d17fe0479d5cb2292f716fd73b200973ae43889f72c51227d311a785)

Change-Id: Id1957e4d6e5ad003592ad46e469ec9f9e78ad58d
changes/27/793127/3
Tobias Urdin 3 weeks ago
parent
commit
3591bd8acc
4 changed files with 34 additions and 87 deletions
  1. +0
    -2
      manifests/params.pp
  2. +14
    -27
      manifests/storage/ceph.pp
  3. +9
    -0
      releasenotes/notes/deprecated-manage-cradox-6a4052d270c5180e.yaml
  4. +11
    -58
      spec/classes/gnocchi_storage_ceph_spec.rb

+ 0
- 2
manifests/params.pp View File

@ -23,7 +23,6 @@ class gnocchi::params {
$indexer_package_name = 'openstack-gnocchi-indexer-sqlalchemy'
$gnocchi_wsgi_script_path = '/var/www/cgi-bin/gnocchi'
$pymysql_package_name = undef
$cradox_package_name = 'python3-cradox'
$redis_package_name = 'python3-redis'
}
'Debian': {
@ -31,7 +30,6 @@ class gnocchi::params {
$indexer_package_name = undef
$gnocchi_wsgi_script_path = '/usr/lib/cgi-bin/gnocchi'
$pymysql_package_name = 'python3-pymysql'
$cradox_package_name = undef
$redis_package_name = 'python3-redis'
}
default: {


+ 14
- 27
manifests/storage/ceph.pp View File

@ -40,18 +40,18 @@
# (optional) Ceph configuration file.
# Defaults to '/etc/ceph/ceph.conf'.
#
# [*manage_rados*]
# (optional) Ensure state of the rados python package.
# Defaults to true.
#
# == DEPRECATED PARAMS
#
# [*manage_cradox*]
# (optional) Ensure state of the cradox package.
# As of ceph jewel the python-rados package should be used. Option
# must be set to false for Ubuntu as there is no cradox package for
# Ubuntu.
# Defaults to true.
#
# [*manage_rados*]
# (optional) Ensure state of the rados python package.
# This option must be set to true for Ubuntu as there is no cradox
# package available for Ubuntu.
# Defaults to false.
# Defaults to undef.
#
class gnocchi::storage::ceph(
$ceph_username,
@ -59,24 +59,19 @@ class gnocchi::storage::ceph(
$ceph_secret = $::os_service_default,
$ceph_pool = 'gnocchi',
$ceph_conffile = '/etc/ceph/ceph.conf',
$manage_cradox = true,
$manage_rados = false,
$manage_rados = true,
## DEPRECATED PARAMS
$manage_cradox = undef,
) inherits gnocchi::params {
include gnocchi::deps
if (is_service_default($ceph_keyring) and is_service_default($ceph_secret)) or (! $ceph_keyring and ! $ceph_secret) {
fail('You need to specify either gnocchi::storage::ceph::ceph_keyring or gnocchi::storage::ceph::ceph_secret.')
}
if $manage_rados and $manage_cradox {
fail('gnocchi::storage::ceph::manage_rados and gnocchi::storage::ceph::manage_cradox both cannot be set to true.')
if $manage_cradox != undef {
warning('gnocchi::storage::ceph::manage_cradox parameter is deprecated and has no effect')
}
if $manage_cradox {
if $::gnocchi::params::cradox_package_name == undef {
fail('gnocchi::storage::ceph::manage_cradox set to true will fail due to no package being available.')
}
if (is_service_default($ceph_keyring) and is_service_default($ceph_secret)) or (! $ceph_keyring and ! $ceph_secret) {
fail('You need to specify either gnocchi::storage::ceph::ceph_keyring or gnocchi::storage::ceph::ceph_secret.')
}
gnocchi_config {
@ -88,14 +83,6 @@ class gnocchi::storage::ceph(
'storage/ceph_conffile': value => $ceph_conffile;
}
if $manage_cradox {
ensure_packages('python-cradox', {
'ensure' => 'present',
'name' => $::gnocchi::params::cradox_package_name,
'tag' => ['openstack','gnocchi-package'],
})
}
if $manage_rados {
ensure_packages('python-rados', {
'ensure' => 'present',


+ 9
- 0
releasenotes/notes/deprecated-manage-cradox-6a4052d270c5180e.yaml View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The gnocchi::storage::ceph::manage_rados parameters default value is now
true.
deprecations:
- |
The gnocchi::storage::ceph::manage_cradox parameter is deprecated and has
no effect.

+ 11
- 58
spec/classes/gnocchi_storage_ceph_spec.rb View File

@ -9,12 +9,10 @@ describe 'gnocchi::storage::ceph' do
{
:ceph_username => 'joe',
:ceph_keyring => 'client.admin',
:manage_cradox => false,
:manage_rados => true,
}
end
shared_examples 'gnocchi storage ceph' do
shared_examples 'gnocchi::storage::ceph' do
context 'with default parameters' do
it 'configures gnocchi-api with default parameters' do
@ -24,6 +22,12 @@ describe 'gnocchi::storage::ceph' do
is_expected.to contain_gnocchi_config('storage/ceph_pool').with_value('gnocchi')
is_expected.to contain_gnocchi_config('storage/ceph_conffile').with_value('/etc/ceph/ceph.conf')
end
it { is_expected.to contain_package('python-rados').with(
:ensure => 'present',
:name => 'python3-rados',
:tag => ['openstack', 'gnocchi-package'],
)}
end
context 'with ceph_secret parameter' do
@ -31,6 +35,7 @@ describe 'gnocchi::storage::ceph' do
params.merge!({
:ceph_secret => 'secrete'})
end
it { is_expected.to contain_gnocchi_config('storage/ceph_secret').with_value('secrete').with_secret(true) }
end
@ -49,60 +54,15 @@ describe 'gnocchi::storage::ceph' do
it { expect { is_expected.to raise_error(Puppet::Error) } }
end
context 'with manage_rados to true' do
before do
params.merge!({
:manage_cradox => false,
:manage_rados => true,
})
end
it { is_expected.not_to contain_package('python-cradox') }
it { is_expected.to contain_package('python-rados').with(:ensure => 'present') }
end
context 'with manage_cradox and manage_rados to true' do
before do
params.merge!({
:manage_cradox => true,
:manage_rados => true,
})
end
it { is_expected.to raise_error(Puppet::Error, /gnocchi::storage::ceph::manage_rados and gnocchi::storage::ceph::manage_cradox both cannot be set to true./) }
end
end
shared_examples 'gnocchi storage ceph cradox redhat' do
context 'with manage_cradox to true' do
context 'with manage_rados to false' do
before do
params.merge!({
:manage_cradox => true,
:manage_rados => false,
})
params.merge!( :manage_rados => false )
end
it { is_expected.to contain_package('python-cradox').with(:ensure => 'present') }
it { is_expected.not_to contain_package('python-rados') }
end
end
shared_examples 'gnocchi storage ceph cradox debian' do
context 'with manage_cradox to true' do
before do
params.merge!({
:manage_cradox => true,
:manage_rados => false,
})
end
it { is_expected.to raise_error(Puppet::Error, /gnocchi::storage::ceph::manage_cradox set to true will fail due to no package being available./) }
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
@ -111,14 +71,7 @@ describe 'gnocchi::storage::ceph' do
facts.merge!(OSDefaults.get_facts())
end
case facts[:osfamily]
when 'Debian'
it_behaves_like 'gnocchi storage ceph cradox debian'
when 'RedHat'
it_behaves_like 'gnocchi storage ceph cradox redhat'
end
it_behaves_like 'gnocchi storage ceph'
it_behaves_like 'gnocchi::storage::ceph'
end
end
end

Loading…
Cancel
Save