diff --git a/manifests/cache.pp b/manifests/cache.pp index cc3d780..ba9511a 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -52,6 +52,18 @@ # Typically this should be left set to false. (boolean value) # Defaults to $facts['os_service_default'] # +# [*socket_timeout*] +# (Optional) Timeout in seconds for every call to a server. +# Defaults to $facts['os_service_default'] +# +# [*username*] +# (Optional) The user name for authentication to backend. +# Defaults to $facts['os_service_default'] +# +# [*password*] +# (Optional) The password for authentication to backend. +# Defaults to $facts['os_service_default'] +# # [*memcache_servers*] # (Optional) Memcache servers in the format of "host:port". # (dogpile.cache.memcache and oslo_cache.memcache_pool backends only). @@ -64,12 +76,6 @@ # backends only). (integer value) # Defaults to $facts['os_service_default'] # -# [*memcache_socket_timeout*] -# (Optional) Timeout in seconds for every call to a server. -# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only). -# (floating point value) -# Defaults to $facts['os_service_default'] -# # [*enable_socket_keepalive*] # (Optional) Global toggle for the socket keepalive of dogpile's # pymemcache backend @@ -117,34 +123,14 @@ # (Optional) Whether SASL is enabled in memcached # Defaults to $facts['os_service_default'] # -# [*memcache_username*] -# (Optional) The user name for the memcached with SASL enabled -# Defaults to $facts['os_service_default'] -# -# [*memcache_password*] -# (Optional) The password for the memcached with SASL enabled -# Defaults to $facts['os_service_default'] -# # [*redis_server*] # (Optional) Redis server in the format of "host:port". # Defaults to $facts['os_service_default'] # -# [*redis_username*] -# (Optional) The user name for redis -# Defaults to $facts['os_service_default'] -# -# [*redis_password*] -# (Optional) The password for redis -# Defaults to $facts['os_service_default'] -# # [*redis_sentinels*] # (Optional) Redis sentinel servers in the format of host:port # Defaults to $facts['os_service_default'] # -# [*redis_socket_timeout*] -# (Optional) Timeout in seconds for every call to a server -# Defaults to $facts['os_service_default'] -# # [*redis_sentinel_service_name*] # (Optional) Service name of the redis sentinel cluster. # Defaults to $facts['os_service_default'] @@ -229,6 +215,32 @@ # back in the pool in the HashClient's internal mechanisms. # Default to undef # +# [*memcache_username*] +# (Optional) The user name for the memcached with SASL enabled +# Default to undef +# +# [*memcache_password*] +# (Optional) The password for the memcached with SASL enabled +# Default to undef +# +# [*redis_username*] +# (Optional) The user name for redis +# Default to undef +# +# [*redis_password*] +# (Optional) The password for redis +# Default to undef +# +# [*memcache_socket_timeout*] +# (Optional) Timeout in seconds for every call to a server. +# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only). +# (floating point value) +# Default to undef +# +# [*redis_socket_timeout*] +# (Optional) Timeout in seconds for every call to a server +# Default to undef +# class watcher::cache ( $config_prefix = $facts['os_service_default'], $expiration_time = $facts['os_service_default'], @@ -238,9 +250,11 @@ class watcher::cache ( $proxies = $facts['os_service_default'], $enabled = $facts['os_service_default'], $debug_cache_backend = $facts['os_service_default'], + $socket_timeout = $facts['os_service_default'], + $username = $facts['os_service_default'], + $password = $facts['os_service_default'], $memcache_servers = $facts['os_service_default'], $memcache_dead_retry = $facts['os_service_default'], - $memcache_socket_timeout = $facts['os_service_default'], $enable_socket_keepalive = $facts['os_service_default'], $socket_keepalive_idle = $facts['os_service_default'], $socket_keepalive_interval = $facts['os_service_default'], @@ -250,13 +264,8 @@ class watcher::cache ( $memcache_pool_connection_get_timeout = $facts['os_service_default'], $memcache_pool_flush_on_reconnect = $facts['os_service_default'], $memcache_sasl_enabled = $facts['os_service_default'], - $memcache_username = $facts['os_service_default'], - $memcache_password = $facts['os_service_default'], $redis_server = $facts['os_service_default'], - $redis_username = $facts['os_service_default'], - $redis_password = $facts['os_service_default'], $redis_sentinels = $facts['os_service_default'], - $redis_socket_timeout = $facts['os_service_default'], $redis_sentinel_service_name = $facts['os_service_default'], $tls_enabled = $facts['os_service_default'], $tls_cafile = $facts['os_service_default'], @@ -270,8 +279,15 @@ class watcher::cache ( $hashclient_retry_timeout = $facts['os_service_default'], $hashclient_dead_timeout = $facts['os_service_default'], Boolean $manage_backend_package = true, + # DEPRECATED PARAMETERS $hashclient_retry_delay = undef, $dead_timeout = undef, + $memcache_username = undef, + $memcache_password = undef, + $redis_username = undef, + $redis_password = undef, + $memcache_socket_timeout = undef, + $redis_socket_timeout = undef, ) { include watcher::deps @@ -284,6 +300,9 @@ class watcher::cache ( proxies => $proxies, enabled => $enabled, debug_cache_backend => $debug_cache_backend, + socket_timeout => $socket_timeout, + username => $username, + password => $password, memcache_servers => $memcache_servers, memcache_dead_retry => $memcache_dead_retry, memcache_socket_timeout => $memcache_socket_timeout, diff --git a/releasenotes/notes/general-opt-names-0af25e366d80dcf1.yaml b/releasenotes/notes/general-opt-names-0af25e366d80dcf1.yaml new file mode 100644 index 0000000..efb45d7 --- /dev/null +++ b/releasenotes/notes/general-opt-names-0af25e366d80dcf1.yaml @@ -0,0 +1,10 @@ +--- +deprecations: + - | + The following parameters of the ``watcher::cache`` class have + been deprecated in favor of the new generic parameters. + + - ``memcache_username`` and ``redis_username`` (Use ``username``) + - ``memcache_password`` and ``redis_password`` (Use ``password``) + - ``memcache_socket_timeout`` and ``redis_socket_timeout`` + (Use ``socket_timeout``) diff --git a/spec/classes/watcher_cache_spec.rb b/spec/classes/watcher_cache_spec.rb index 5e742c8..6b1bde6 100644 --- a/spec/classes/watcher_cache_spec.rb +++ b/spec/classes/watcher_cache_spec.rb @@ -19,9 +19,12 @@ describe 'watcher::cache' do :proxies => '', :enabled => '', :debug_cache_backend => '', + :socket_timeout => '', + :username => '', + :password => '', :memcache_servers => '', :memcache_dead_retry => '', - :memcache_socket_timeout => '', + :memcache_socket_timeout => nil, :enable_socket_keepalive => '', :socket_keepalive_idle => '', :socket_keepalive_interval => '', @@ -31,13 +34,13 @@ describe 'watcher::cache' do :memcache_pool_connection_get_timeout => '', :memcache_pool_flush_on_reconnect => '', :memcache_sasl_enabled => '', - :memcache_username => '', - :memcache_password => '', + :memcache_username => nil, + :memcache_password => nil, :redis_server => '', - :redis_username => '', - :redis_password => '', + :redis_username => nil, + :redis_password => nil, :redis_sentinels => '', - :redis_socket_timeout => '', + :redis_socket_timeout => nil, :redis_sentinel_service_name => '', :tls_enabled => '', :tls_cafile => '', @@ -67,9 +70,12 @@ describe 'watcher::cache' do :proxies => ['proxy01:8888', 'proxy02:8888'], :enabled => true, :debug_cache_backend => false, + :socket_timeout => 3.0, + :username => 'user', + :password => 'pass', :memcache_servers => ['memcached01:11211', 'memcached02:11211'], :memcache_dead_retry => '60', - :memcache_socket_timeout => '300.0', + :memcache_socket_timeout => 3.1, :enable_socket_keepalive => false, :socket_keepalive_idle => 1, :socket_keepalive_interval => 1, @@ -85,7 +91,7 @@ describe 'watcher::cache' do :redis_username => 'redisuser', :redis_password => 'redispass', :redis_sentinels => ['host1:26379', 'host2:26379'], - :redis_socket_timeout => 1.0, + :redis_socket_timeout => 3.2, :redis_sentinel_service_name => 'mymaster', :tls_enabled => false, :enable_retry_client => false, @@ -110,9 +116,12 @@ describe 'watcher::cache' do :proxies => ['proxy01:8888', 'proxy02:8888'], :enabled => true, :debug_cache_backend => false, + :socket_timeout => 3.0, + :username => 'user', + :password => 'pass', :memcache_servers => ['memcached01:11211', 'memcached02:11211'], :memcache_dead_retry => '60', - :memcache_socket_timeout => '300.0', + :memcache_socket_timeout => 3.1, :enable_socket_keepalive => false, :socket_keepalive_idle => 1, :socket_keepalive_interval => 1, @@ -128,7 +137,7 @@ describe 'watcher::cache' do :redis_username => 'redisuser', :redis_password => 'redispass', :redis_sentinels => ['host1:26379', 'host2:26379'], - :redis_socket_timeout => 1.0, + :redis_socket_timeout => 3.2, :redis_sentinel_service_name => 'mymaster', :tls_enabled => false, :tls_cafile => '',