Browse Source

Add more oslo::cache params to init

This adds two new parameters cache_backend
and manage_backend_package that is simply
proxy parameters that is passed down to
oslo::cache like all other modules.

This does not introduce a behavior change
since cache_backend defaults to
$::os_service_default we do not enforce
any new package installs even though
manage_backend_package is set to true
(like it was before since that is
oslo::cache default)

Updates the testing so we test for the
oslo::cache resource and not the functionality
that the resource itself has.

Change-Id: Ib6f6853dd34e83e757bee0382ee84141e3f4dbd8
changes/25/731125/1
Tobias Urdin 2 years ago
parent
commit
2b44bcb990
  1. 14
      manifests/init.pp
  2. 5
      releasenotes/notes/add-more-oslo-cache-params-to-init-70207eea609cf621.yaml
  3. 16
      spec/classes/ceilometer_init_spec.rb

14
manifests/init.pp

@ -125,10 +125,18 @@
# (string value)
# Defaults to $::os_service_default
#
# [*cache_backend*]
# (Optional) The backend to pass to oslo::cache.
# Defaults to $::os_service_default
#
# [*memcache_servers*]
# (Optional) A list of memcached server(s) to use for caching. (list value)
# Defaults to $::os_service_default
#
# [*manage_backend_package*]
# (Optional) If we should install the cache backend package.
# Defaults to true
#
# [*amqp_server_request_prefix*]
# (Optional) Address prefix used when sending to a specific server
# Defaults to $::os_service_default.
@ -244,7 +252,9 @@ class ceilometer(
$kombu_reconnect_delay = $::os_service_default,
$kombu_failover_strategy = $::os_service_default,
$kombu_compression = $::os_service_default,
$cache_backend = $::os_service_default,
$memcache_servers = $::os_service_default,
$manage_backend_package = true,
$amqp_server_request_prefix = $::os_service_default,
$amqp_broadcast_prefix = $::os_service_default,
$amqp_group_request_prefix = $::os_service_default,
@ -357,6 +367,8 @@ class ceilometer(
}
oslo::cache { 'ceilometer_config':
memcache_servers => $memcache_servers,
backend => $cache_backend,
memcache_servers => $memcache_servers,
manage_backend_package => $manage_backend_package,
}
}

5
releasenotes/notes/add-more-oslo-cache-params-to-init-70207eea609cf621.yaml

@ -0,0 +1,5 @@
---
features:
- |
Added cache_backend and manage_backend_package parameters to ceilometer
class that is passed down to the oslo::cache resource.

16
spec/classes/ceilometer_init_spec.rb

@ -123,7 +123,11 @@ describe 'ceilometer' do
end
it 'configures cache backend' do
is_expected.to contain_ceilometer_config('cache/memcache_servers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_oslo__cache('ceilometer_config').with(
:backend => '<SERVICE DEFAULT>',
:memcache_servers => '<SERVICE DEFAULT>',
:manage_backend_package => true,
)
end
context 'with rabbitmq durable queues configured' do
@ -152,12 +156,18 @@ describe 'ceilometer' do
context 'with overridden cache parameter' do
before {
params.merge!(
:memcache_servers => 'host1:11211,host2:11211',
:cache_backend => 'memcache',
:memcache_servers => 'host1:11211,host2:11211',
:manage_backend_package => false,
)
}
it 'configures cache backend' do
is_expected.to contain_ceilometer_config('cache/memcache_servers').with_value('host1:11211,host2:11211')
is_expected.to contain_oslo__cache('ceilometer_config').with(
:backend => 'memcache',
:memcache_servers => 'host1:11211,host2:11211',
:manage_backend_package => false,
)
end
end

Loading…
Cancel
Save