Drop redundant default of cache_tls_enabled

The tls_enabled option defaults to false, so we don't have to make
the class parameter default to false explicitly but can use the service
default.

Change-Id: I023855904460280e86073c0301e420255b25e6f2
This commit is contained in:
Takashi Kajinami 2023-12-04 15:22:52 +09:00
parent 9c10d867f3
commit d0b20eb5d9
8 changed files with 42 additions and 30 deletions

View File

@ -51,7 +51,7 @@
# [*cache_tls_enabled*]
# (Optional) Global toggle for TLS usage when communicating with
# the caching servers.
# Default to false
# Defaults to $facts['os_service_default']
#
# [*cache_tls_cafile*]
# (Optional) Path to a file of concatenated CA certificates in PEM
@ -84,7 +84,7 @@ class swift::containerreconciler(
$request_tries = $facts['os_service_default'],
$service_provider = $::swift::params::service_provider,
$memcache_servers = ['127.0.0.1:11211'],
$cache_tls_enabled = false,
$cache_tls_enabled = $facts['os_service_default'],
$cache_tls_cafile = $facts['os_service_default'],
$cache_tls_certfile = $facts['os_service_default'],
$cache_tls_keyfile = $facts['os_service_default'],

View File

@ -7,13 +7,13 @@
# [*tls_enabled*]
# (Optional) Global toggle for TLS usage when communicating with
# the caching servers.
# Default to false
# Defaults to $facts['os_service_default'].
#
# [*tls_cafile*]
# (Optional) Path to a file of concatenated CA certificates in PEM
# format necessary to establish the caching server's authenticity.
# If tls_enabled is False, this option is ignored.
# Defaults to undef
# Defaults to $facts['os_service_default'].
#
# [*tls_certfile*]
# (Optional) Path to a single file in PEM format containing the
@ -21,14 +21,14 @@
# needed to establish the certificate's authenticity. This file
# is only required when client side authentication is necessary.
# If tls_enabled is False, this option is ignored.
# Defaults to undef
# Defaults to $facts['os_service_default'].
#
# [*tls_keyfile*]
# (Optional) Path to a single file containing the client's private
# key in. Otherwise the private key will be taken from the file
# specified in tls_certfile. If tls_enabled is False, this option
# is ignored.
# Defaults to undef
# Defaults to $facts['os_service_default'].
#
# [*memcache_max_connections*] Sets the maximum number of connections to
# each memcached server per worker
@ -49,10 +49,10 @@
#
class swift::internal_client::cache(
$memcache_servers = ['127.0.0.1:11211'],
$tls_enabled = false,
$tls_cafile = undef,
$tls_certfile = undef,
$tls_keyfile = undef,
$tls_enabled = $facts['os_service_default'],
$tls_cafile = $facts['os_service_default'],
$tls_certfile = $facts['os_service_default'],
$tls_keyfile = $facts['os_service_default'],
$memcache_max_connections = '2'
) {

View File

@ -70,13 +70,13 @@
# [*cache_tls_enabled*]
# (Optional) Global toggle for TLS usage when communicating with
# the caching servers.
# Default to false
# Defaults to $facts['os_service_default'].
#
# [*cache_tls_cafile*]
# (Optional) Path to a file of concatenated CA certificates in PEM
# format necessary to establish the caching server's authenticity.
# If tls_enabled is False, this option is ignored.
# Defaults to undef
# Defaults to $facts['os_service_default'].
#
# [*cache_tls_certfile*]
# (Optional) Path to a single file in PEM format containing the
@ -84,14 +84,14 @@
# needed to establish the certificate's authenticity. This file
# is only required when client side authentication is necessary.
# If tls_enabled is False, this option is ignored.
# Defaults to undef
# Defaults to $facts['os_service_default'].
#
# [*cache_tls_keyfile*]
# (Optional) Path to a single file containing the client's private
# key in. Otherwise the private key will be taken from the file
# specified in tls_certfile. If tls_enabled is False, this option
# is ignored.
# Defaults to undef
# Defaults to $facts['os_service_default'].
#
# [*log_level*]
# (optional) Log level.
@ -116,10 +116,10 @@ class swift::objectexpirer(
$report_interval = $facts['os_service_default'],
$service_provider = $::swift::params::service_provider,
$memcache_servers = ['127.0.0.1:11211'],
$cache_tls_enabled = false,
$cache_tls_cafile = undef,
$cache_tls_certfile = undef,
$cache_tls_keyfile = undef,
$cache_tls_enabled = $facts['os_service_default'],
$cache_tls_cafile = $facts['os_service_default'],
$cache_tls_certfile = $facts['os_service_default'],
$cache_tls_keyfile = $facts['os_service_default'],
$log_level = 'INFO',
$log_facility = 'LOG_LOCAL2',
) inherits swift::params {

View File

@ -7,13 +7,13 @@
# [*tls_enabled*]
# (Optional) Global toggle for TLS usage when communicating with
# the caching servers.
# Default to false
# Default to $facts['os_service_default']
#
# [*tls_cafile*]
# (Optional) Path to a file of concatenated CA certificates in PEM
# format necessary to establish the caching server's authenticity.
# If tls_enabled is False, this option is ignored.
# Defaults to undef
# Default to $facts['os_service_default']
#
# [*tls_certfile*]
# (Optional) Path to a single file in PEM format containing the
@ -21,14 +21,14 @@
# needed to establish the certificate's authenticity. This file
# is only required when client side authentication is necessary.
# If tls_enabled is False, this option is ignored.
# Defaults to undef
# Default to $facts['os_service_default']
#
# [*tls_keyfile*]
# (Optional) Path to a single file containing the client's private
# key in. Otherwise the private key will be taken from the file
# specified in tls_certfile. If tls_enabled is False, this option
# is ignored.
# Defaults to undef
# Default to $facts['os_service_default']
#
# [*memcache_max_connections*] Sets the maximum number of connections to
# each memcached server per worker
@ -49,10 +49,10 @@
#
class swift::proxy::cache(
$memcache_servers = ['127.0.0.1:11211'],
$tls_enabled = false,
$tls_cafile = undef,
$tls_certfile = undef,
$tls_keyfile = undef,
$tls_enabled = $facts['os_service_default'],
$tls_cafile = $facts['os_service_default'],
$tls_certfile = $facts['os_service_default'],
$tls_keyfile = $facts['os_service_default'],
$memcache_max_connections = '2'
) {

View File

@ -76,7 +76,7 @@ describe 'swift::containerreconciler' do
is_expected.to contain_swift_container_reconciler_config(
'filter:cache/memcache_servers').with_value('127.0.0.1:11211')
is_expected.to contain_swift_container_reconciler_config(
'filter:cache/tls_enabled').with_value(false)
'filter:cache/tls_enabled').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_container_reconciler_config(
'filter:cache/tls_cafile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_container_reconciler_config(

View File

@ -22,7 +22,10 @@ describe 'swift::internal_client::cache' do
it { is_expected.to contain_swift_internal_client_config('filter:cache/use').with_value('egg:swift#memcache') }
it { is_expected.to contain_swift_internal_client_config('filter:cache/memcache_servers').with_value('127.0.0.1:11211') }
it { is_expected.to contain_swift_internal_client_config('filter:cache/tls_enabled').with_value(false) }
it { is_expected.to contain_swift_internal_client_config('filter:cache/tls_enabled').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_internal_client_config('filter:cache/tls_cafile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_internal_client_config('filter:cache/tls_certfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_internal_client_config('filter:cache/tls_keyfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_internal_client_config('filter:cache/memcache_max_connections').with_value(2) }
end

View File

@ -38,7 +38,13 @@ describe 'swift::objectexpirer' do
is_expected.to contain_swift_object_expirer_config(
'filter:cache/memcache_servers').with_value('127.0.0.1:11211')
is_expected.to contain_swift_object_expirer_config(
'filter:cache/tls_enabled').with_value(false)
'filter:cache/tls_enabled').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_object_expirer_config(
'filter:cache/tls_cafile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_object_expirer_config(
'filter:cache/tls_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_object_expirer_config(
'filter:cache/tls_keyfile').with_value('<SERVICE DEFAULT>')
end
it 'configures object-expirer service' do

View File

@ -22,7 +22,10 @@ describe 'swift::proxy::cache' do
it { is_expected.to contain_swift_proxy_config('filter:cache/use').with_value('egg:swift#memcache') }
it { is_expected.to contain_swift_proxy_config('filter:cache/memcache_servers').with_value('127.0.0.1:11211') }
it { is_expected.to contain_swift_proxy_config('filter:cache/tls_enabled').with_value(false) }
it { is_expected.to contain_swift_proxy_config('filter:cache/tls_enabled').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:cache/tls_cafile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:cache/tls_certfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:cache/tls_keyfile').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:cache/memcache_max_connections').with_value(2) }
end