diff --git a/manifests/cache.pp b/manifests/cache.pp index 2b5a839..9af64a0 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -168,6 +168,21 @@ # be available. # Default to $::os_service_default # +# [*enable_retry_client*] +# (Optional) Enable retry client mechanisms to handle failure. +# Those mechanisms can be used to wrap all kind of pymemcache +# clients. The wrapper allows you to define how many attempts +# to make and how long to wait between attemots. +# Default to $::os_service_default +# +# [*retry_attempts*] +# (Optional) Number of times to attempt an action before failing. +# Default to $::os_service_default +# +# [*retry_delay*] +# (Optional) Number of seconds to sleep between each attempt. +# Default to $::os_service_default +# # [*manage_backend_package*] # (Optional) Whether to install the backend package. # Defaults to true. @@ -195,6 +210,9 @@ define oslo::cache( $tls_certfile = $::os_service_default, $tls_keyfile = $::os_service_default, $tls_allowed_ciphers = $::os_service_default, + $enable_retry_client = $::os_service_default, + $retry_attempts = $::os_service_default, + $retry_delay = $::os_service_default, $manage_backend_package = true, ){ @@ -256,6 +274,9 @@ define oslo::cache( 'cache/tls_certfile' => { value => $tls_certfile }, 'cache/tls_keyfile' => { value => $tls_keyfile }, 'cache/tls_allowed_ciphers' => { value => $tls_allowed_ciphers }, + 'cache/enable_retry_client' => { value => $enable_retry_client }, + 'cache/retry_attempts' => { value => $retry_attempts }, + 'cache/retry_delay' => { value => $retry_delay }, } create_resources($name, $cache_options) diff --git a/releasenotes/notes/pymemcache_retrying-4fa326e3bc913a97.yaml b/releasenotes/notes/pymemcache_retrying-4fa326e3bc913a97.yaml new file mode 100644 index 0000000..ca381f5 --- /dev/null +++ b/releasenotes/notes/pymemcache_retrying-4fa326e3bc913a97.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add retrying options for pymemcache (dogpile.cache) backend. diff --git a/spec/defines/oslo_cache_spec.rb b/spec/defines/oslo_cache_spec.rb index 4577dcc..7846b11 100644 --- a/spec/defines/oslo_cache_spec.rb +++ b/spec/defines/oslo_cache_spec.rb @@ -30,6 +30,9 @@ describe 'oslo::cache' do is_expected.to contain_keystone_config('cache/tls_certfile').with_value('') is_expected.to contain_keystone_config('cache/tls_keyfile').with_value('') is_expected.to contain_keystone_config('cache/tls_allowed_ciphers').with_value('') + is_expected.to contain_keystone_config('cache/enable_retry_client').with_value('') + is_expected.to contain_keystone_config('cache/retry_attempts').with_value('') + is_expected.to contain_keystone_config('cache/retry_delay').with_value('') end end @@ -58,6 +61,9 @@ describe 'oslo::cache' do :tls_certfile => nil, :tls_keyfile => nil, :tls_allowed_ciphers => nil, + :enable_retry_client => false, + :retry_attempts => 2, + :retry_delay => 0, } end @@ -84,6 +90,9 @@ describe 'oslo::cache' do is_expected.to contain_keystone_config('cache/tls_certfile').with_value('nil') is_expected.to contain_keystone_config('cache/tls_keyfile').with_value('nil') is_expected.to contain_keystone_config('cache/tls_allowed_ciphers').with_value('nil') + is_expected.to contain_keystone_config('cache/enable_retry_client').with_value('false') + is_expected.to contain_keystone_config('cache/retry_attempts').with_value('2') + is_expected.to contain_keystone_config('cache/retry_delay').with_value('0') end end