From 3832c80d64883212761ff32d22e9df2fc727ac96 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 1 Mar 2024 10:39:17 +0900 Subject: [PATCH] cache: Support options for SASL mechanism in memcached Depends-on: https://review.opendev.org/910122 Change-Id: Ib722982e06a15396d09d9ff380abe4f24b0280da --- manifests/cache.pp | 36 ++++++++++++++----- .../cache-memcache-sasl-6c1d07f71d2d24c2.yaml | 5 +++ spec/classes/neutron_cache_spec.rb | 9 +++++ 3 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/cache-memcache-sasl-6c1d07f71d2d24c2.yaml diff --git a/manifests/cache.pp b/manifests/cache.pp index 9f64179dd..3d6971def 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -108,9 +108,17 @@ # (oslo_cache.memcache_pool backend only) # Defaults to $facts['os_service_default'] # -# [*manage_backend_package*] -# (Optional) Whether to install the backend package for the cache. -# Defaults to true +# [*memcache_sasl_enabled*] +# (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'] # # [*tls_enabled*] # (Optional) Global toggle for TLS usage when communicating with @@ -176,6 +184,10 @@ # back in the pool in the HashClient's internal mechanisms. # Default to $facts['os_service_default'] # +# [*manage_backend_package*] +# (Optional) Whether to install the backend package for the cache. +# Defaults to true +# class neutron::cache ( $config_prefix = $facts['os_service_default'], $expiration_time = $facts['os_service_default'], @@ -187,15 +199,17 @@ class neutron::cache ( $memcache_servers = $facts['os_service_default'], $memcache_dead_retry = $facts['os_service_default'], $memcache_socket_timeout = $facts['os_service_default'], - $memcache_pool_maxsize = $facts['os_service_default'], - $memcache_pool_unused_timeout = $facts['os_service_default'], - $memcache_pool_connection_get_timeout = $facts['os_service_default'], - $memcache_pool_flush_on_reconnect = $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'], $socket_keepalive_count = $facts['os_service_default'], - $manage_backend_package = true, + $memcache_pool_maxsize = $facts['os_service_default'], + $memcache_pool_unused_timeout = $facts['os_service_default'], + $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'], $tls_enabled = $facts['os_service_default'], $tls_cafile = $facts['os_service_default'], $tls_certfile = $facts['os_service_default'], @@ -207,6 +221,7 @@ class neutron::cache ( $hashclient_retry_attempts = $facts['os_service_default'], $hashclient_retry_delay = $facts['os_service_default'], $dead_timeout = $facts['os_service_default'], + Boolean $manage_backend_package = true, ) { include neutron::deps @@ -230,7 +245,9 @@ class neutron::cache ( memcache_pool_unused_timeout => $memcache_pool_unused_timeout, memcache_pool_connection_get_timeout => $memcache_pool_connection_get_timeout, memcache_pool_flush_on_reconnect => $memcache_pool_flush_on_reconnect, - manage_backend_package => $manage_backend_package, + memcache_sasl_enabled => $memcache_sasl_enabled, + memcache_username => $memcache_username, + memcache_password => $memcache_password, tls_enabled => $tls_enabled, tls_cafile => $tls_cafile, tls_certfile => $tls_certfile, @@ -242,5 +259,6 @@ class neutron::cache ( hashclient_retry_attempts => $hashclient_retry_attempts, hashclient_retry_delay => $hashclient_retry_delay, dead_timeout => $dead_timeout, + manage_backend_package => $manage_backend_package, } } diff --git a/releasenotes/notes/cache-memcache-sasl-6c1d07f71d2d24c2.yaml b/releasenotes/notes/cache-memcache-sasl-6c1d07f71d2d24c2.yaml new file mode 100644 index 000000000..4bb6da9b0 --- /dev/null +++ b/releasenotes/notes/cache-memcache-sasl-6c1d07f71d2d24c2.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The ``neutron::cache`` class now supports options to allow memcached with + SASL enabled. diff --git a/spec/classes/neutron_cache_spec.rb b/spec/classes/neutron_cache_spec.rb index 7e401e835..a33fd745d 100644 --- a/spec/classes/neutron_cache_spec.rb +++ b/spec/classes/neutron_cache_spec.rb @@ -29,6 +29,9 @@ describe 'neutron::cache' do :memcache_pool_unused_timeout => '', :memcache_pool_connection_get_timeout => '', :memcache_pool_flush_on_reconnect => '', + :memcache_sasl_enabled => '', + :memcache_username => '', + :memcache_password => '', :tls_enabled => '', :tls_cafile => '', :tls_certfile => '', @@ -65,6 +68,9 @@ describe 'neutron::cache' do :memcache_pool_unused_timeout => '120', :memcache_pool_connection_get_timeout => '360', :memcache_pool_flush_on_reconnect => false, + :memcache_sasl_enabled => false, + :memcache_username => 'sasluser', + :memcache_password => 'saslpass', :tls_enabled => false, :enable_retry_client => false, :retry_attempts => 2, @@ -96,6 +102,9 @@ describe 'neutron::cache' do :memcache_pool_unused_timeout => '120', :memcache_pool_connection_get_timeout => '360', :memcache_pool_flush_on_reconnect => false, + :memcache_sasl_enabled => false, + :memcache_username => 'sasluser', + :memcache_password => 'saslpass', :tls_enabled => false, :tls_cafile => '', :tls_certfile => '',