Support more log_address options

Support customizing log_address options for object-expirer and
container-reconciler for better parameter coverage.

Change-Id: I60a2fef439e2e70019d906bab33c8ea7ebe9098e
This commit is contained in:
Takashi Kajinami 2024-10-26 18:18:26 +09:00
parent 90a97dbbbc
commit e4941136f1
5 changed files with 23 additions and 0 deletions

View File

@ -99,6 +99,10 @@
# (optional) Log level # (optional) Log level
# Defaults to 'LOG_LOCAL2'. # Defaults to 'LOG_LOCAL2'.
# #
# [*log_address*]
# (optional) Location where syslog sends the logs to.
# Defaults to '/dev/log'.
#
# [*purge_config*] # [*purge_config*]
# (optional) Whether to set only the specified config options # (optional) Whether to set only the specified config options
# in the proxy config. # in the proxy config.
@ -124,6 +128,7 @@ class swift::containerreconciler(
$log_name = $facts['os_service_default'], $log_name = $facts['os_service_default'],
$log_level = 'INFO', $log_level = 'INFO',
$log_facility = 'LOG_LOCAL2', $log_facility = 'LOG_LOCAL2',
$log_address = '/dev/log',
Boolean $purge_config = false, Boolean $purge_config = false,
) inherits swift::params { ) inherits swift::params {
@ -191,6 +196,7 @@ class swift::containerreconciler(
'container-reconciler/log_name': value => $log_name; 'container-reconciler/log_name': value => $log_name;
'container-reconciler/log_facility': value => $log_facility; 'container-reconciler/log_facility': value => $log_facility;
'container-reconciler/log_level': value => $log_level; 'container-reconciler/log_level': value => $log_level;
'container-reconciler/log_address': value => $log_address;
} }
if $manage_service { if $manage_service {

View File

@ -105,6 +105,10 @@
# (optional) Log level # (optional) Log level
# Defaults to 'LOG_LOCAL2'. # Defaults to 'LOG_LOCAL2'.
# #
# [*log_address*]
# (optional) Location where syslog sends the logs to.
# Defaults to '/dev/log'.
#
# [*purge_config*] # [*purge_config*]
# (optional) Whether to set only the specified config options # (optional) Whether to set only the specified config options
# in the object expirer config. # in the object expirer config.
@ -132,6 +136,7 @@ class swift::objectexpirer(
$log_name = $facts['os_service_default'], $log_name = $facts['os_service_default'],
$log_level = 'INFO', $log_level = 'INFO',
$log_facility = 'LOG_LOCAL2', $log_facility = 'LOG_LOCAL2',
$log_address = '/dev/log',
Boolean $purge_config = false, Boolean $purge_config = false,
) inherits swift::params { ) inherits swift::params {
@ -211,6 +216,7 @@ class swift::objectexpirer(
'object-expirer/log_name': value => $log_name; 'object-expirer/log_name': value => $log_name;
'object-expirer/log_facility': value => $log_facility; 'object-expirer/log_facility': value => $log_facility;
'object-expirer/log_level': value => $log_level; 'object-expirer/log_level': value => $log_level;
'object-expirer/log_address': value => $log_address;
} }
if $manage_service { if $manage_service {

View File

@ -0,0 +1,7 @@
---
features:
- |
The new ``swift::objectexpirer::log_address`` option has been added.
- |
The new ``swift::containerreconciler::log_address`` option has been added.

View File

@ -40,6 +40,8 @@ describe 'swift::containerreconciler' do
'container-reconciler/log_level').with_value('INFO') 'container-reconciler/log_level').with_value('INFO')
is_expected.to contain_swift_container_reconciler_config( is_expected.to contain_swift_container_reconciler_config(
'container-reconciler/log_facility').with_value('LOG_LOCAL2') 'container-reconciler/log_facility').with_value('LOG_LOCAL2')
is_expected.to contain_swift_container_reconciler_config(
'container-reconciler/log_address').with_value('/dev/log')
is_expected.to contain_swift_container_reconciler_config( is_expected.to contain_swift_container_reconciler_config(
'filter:cache/memcache_servers').with_value('127.0.0.1:11211') 'filter:cache/memcache_servers').with_value('127.0.0.1:11211')
is_expected.to contain_swift_container_reconciler_config( is_expected.to contain_swift_container_reconciler_config(

View File

@ -44,6 +44,8 @@ describe 'swift::objectexpirer' do
'object-expirer/log_level').with_value('INFO') 'object-expirer/log_level').with_value('INFO')
is_expected.to contain_swift_object_expirer_config( is_expected.to contain_swift_object_expirer_config(
'object-expirer/log_facility').with_value('LOG_LOCAL2') 'object-expirer/log_facility').with_value('LOG_LOCAL2')
is_expected.to contain_swift_object_expirer_config(
'object-expirer/log_address').with_value('/dev/log')
is_expected.to contain_swift_object_expirer_config( is_expected.to contain_swift_object_expirer_config(
'filter:cache/memcache_servers').with_value('127.0.0.1:11211') 'filter:cache/memcache_servers').with_value('127.0.0.1:11211')
is_expected.to contain_swift_object_expirer_config( is_expected.to contain_swift_object_expirer_config(