diff --git a/manifests/cache.pp b/manifests/cache.pp index e4b9fe0..f1a7373 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -50,6 +50,11 @@ # (integer value) # Defaults to $facts['os_service_default'] # +# [*backend_expiration_time*] +# (Optional) Expiration time in cache backend to purge expired records +# automatically. +# Defaults to $facts['os_service_default'] +# # [*backend*] # (Optional) Dogpile.cache backend module. It is recommended that # Memcache with pooling (oslo_cache.memcache_pool) or Redis @@ -251,6 +256,7 @@ define oslo::cache( $config_prefix = $facts['os_service_default'], $expiration_time = $facts['os_service_default'], + $backend_expiration_time = $facts['os_service_default'], $backend = $facts['os_service_default'], $backend_argument = $facts['os_service_default'], $proxies = $facts['os_service_default'], @@ -360,6 +366,7 @@ define oslo::cache( $cache_options = { 'cache/config_prefix' => { value => $config_prefix }, 'cache/expiration_time' => { value => $expiration_time }, + 'cache/backend_expiration_time' => { value => $backend_expiration_time }, 'cache/backend' => { value => $backend }, 'cache/backend_argument' => { value => $backend_argument }, 'cache/proxies' => { value => join(any2array($proxies), ',') }, diff --git a/releasenotes/notes/cache-backend-expiration-time-78bd3c1ebb3ab7c5.yaml b/releasenotes/notes/cache-backend-expiration-time-78bd3c1ebb3ab7c5.yaml new file mode 100644 index 0000000..5f3d5be --- /dev/null +++ b/releasenotes/notes/cache-backend-expiration-time-78bd3c1ebb3ab7c5.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``oslo::cache::backend_expiration_time`` parameter has been added. diff --git a/spec/defines/oslo_cache_spec.rb b/spec/defines/oslo_cache_spec.rb index 616bf91..25469dc 100644 --- a/spec/defines/oslo_cache_spec.rb +++ b/spec/defines/oslo_cache_spec.rb @@ -10,6 +10,7 @@ describe 'oslo::cache' do it 'configure oslo_cache default params' do is_expected.to contain_keystone_config('cache/config_prefix').with_value('') is_expected.to contain_keystone_config('cache/expiration_time').with_value('') + is_expected.to contain_keystone_config('cache/backend_expiration_time').with_value('') is_expected.to contain_keystone_config('cache/backend').with_value('') is_expected.to contain_keystone_config('cache/backend_argument').with_value('') is_expected.to contain_keystone_config('cache/proxies').with_value('') @@ -53,7 +54,8 @@ describe 'oslo::cache' do let :params do { :config_prefix => 'cache.oslo', - :expiration_time => '600', + :expiration_time => 600, + :backend_expiration_time => 700, :backend => 'dogpile.cache.null', :backend_argument => ['arg1:val1', 'arg2:val2'], :proxies => ['proxy1', 'proxy2'], @@ -95,7 +97,8 @@ describe 'oslo::cache' do it 'configures cache section' do is_expected.to contain_keystone_config('cache/config_prefix').with_value('cache.oslo') - is_expected.to contain_keystone_config('cache/expiration_time').with_value('600') + is_expected.to contain_keystone_config('cache/expiration_time').with_value(600) + is_expected.to contain_keystone_config('cache/backend_expiration_time').with_value(700) is_expected.to contain_keystone_config('cache/backend').with_value('dogpile.cache.null') is_expected.to contain_keystone_config('cache/backend_argument').with_value(['arg1:val1', 'arg2:val2']) is_expected.to contain_keystone_config('cache/proxies').with_value('proxy1,proxy2')