Add type definitions for log parameters
Change-Id: I1348501a0d6f1c9962bb8fe3b764444364957add Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -70,7 +70,7 @@ class swift::bench (
|
||||
$swift_user = 'test:tester',
|
||||
$swift_key = 'testing',
|
||||
$auth_version = '1.0',
|
||||
$log_level = 'INFO',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
$test_timeout = '10',
|
||||
$put_concurrency = '10',
|
||||
$get_concurrency = '10',
|
||||
|
@@ -129,10 +129,10 @@ class swift::containerreconciler (
|
||||
$cache_tls_cafile = $facts['os_service_default'],
|
||||
$cache_tls_certfile = $facts['os_service_default'],
|
||||
$cache_tls_keyfile = $facts['os_service_default'],
|
||||
$log_name = 'container-reconciler',
|
||||
$log_level = 'INFO',
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
$log_address = '/dev/log',
|
||||
String[1] $log_name = 'container-reconciler',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
Swift::LogFacility $log_facility = 'LOG_LOCAL2',
|
||||
String[1] $log_address = '/dev/log',
|
||||
$log_max_line_length = $facts['os_service_default'],
|
||||
Boolean $purge_config = false,
|
||||
) inherits swift::params {
|
||||
|
@@ -149,10 +149,10 @@ class swift::objectexpirer (
|
||||
$cache_tls_cafile = $facts['os_service_default'],
|
||||
$cache_tls_certfile = $facts['os_service_default'],
|
||||
$cache_tls_keyfile = $facts['os_service_default'],
|
||||
$log_name = 'object-expirer',
|
||||
$log_level = 'INFO',
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
$log_address = '/dev/log',
|
||||
String[1] $log_name = 'object-expirer',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
Swift::LogFacility $log_facility = 'LOG_LOCAL2',
|
||||
String[1] $log_address = '/dev/log',
|
||||
$log_max_line_length = $facts['os_service_default'],
|
||||
Boolean $purge_config = false,
|
||||
# DEPRECATED PARAMETERS
|
||||
|
@@ -220,11 +220,11 @@ class swift::proxy (
|
||||
$log_headers = $facts['os_service_default'],
|
||||
$log_udp_host = $facts['os_service_default'],
|
||||
$log_udp_port = $facts['os_service_default'],
|
||||
$log_address = '/dev/log',
|
||||
$log_level = 'INFO',
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
String[1] $log_address = '/dev/log',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
Swift::LogFacility $log_facility = 'LOG_LOCAL2',
|
||||
$log_handoffs = $facts['os_service_default'],
|
||||
$log_name = 'proxy-server',
|
||||
String[1] $log_name = 'proxy-server',
|
||||
$log_max_line_length = $facts['os_service_default'],
|
||||
$cors_allow_origin = $facts['os_service_default'],
|
||||
$strict_cors_mode = $facts['os_service_default'],
|
||||
|
@@ -44,8 +44,8 @@
|
||||
#
|
||||
class swift::proxy::cname_lookup (
|
||||
$log_name = $facts['os_service_default'],
|
||||
$log_facility = $facts['os_service_default'],
|
||||
$log_level = $facts['os_service_default'],
|
||||
Optional[Swift::LogFacility] $log_facility = undef,
|
||||
Optional[Swift::LogLevel] $log_level = undef,
|
||||
$log_headers = $facts['os_service_default'],
|
||||
$log_address = $facts['os_service_default'],
|
||||
$storage_domain = $facts['os_service_default'],
|
||||
@@ -57,11 +57,20 @@ class swift::proxy::cname_lookup (
|
||||
|
||||
Package['python3-dnspython'] ~> Service<| tag == 'swift-proxy-service' |>
|
||||
|
||||
$log_facility_real = $log_facility ? {
|
||||
undef => $facts['os_service_default'],
|
||||
default => $log_facility,
|
||||
}
|
||||
$log_level_real = $log_level ? {
|
||||
undef => $facts['os_service_default'],
|
||||
default => $log_level,
|
||||
}
|
||||
|
||||
swift_proxy_config {
|
||||
'filter:cname_lookup/use': value => 'egg:swift#cname_lookup';
|
||||
'filter:cname_lookup/set log_name': value => $log_name;
|
||||
'filter:cname_lookup/set log_facility': value => $log_facility;
|
||||
'filter:cname_lookup/set log_level': value => $log_level;
|
||||
'filter:cname_lookup/set log_facility': value => $log_facility_real;
|
||||
'filter:cname_lookup/set log_level': value => $log_level_real;
|
||||
'filter:cname_lookup/set log_headers': value => $log_headers;
|
||||
'filter:cname_lookup/set log_address': value => $log_address;
|
||||
'filter:cname_lookup/storage_domain' : value => $storage_domain;
|
||||
|
@@ -69,8 +69,8 @@
|
||||
#
|
||||
class swift::proxy::domain_remap (
|
||||
$log_name = $facts['os_service_default'],
|
||||
$log_facility = $facts['os_service_default'],
|
||||
$log_level = $facts['os_service_default'],
|
||||
Optional[Swift::LogFacility] $log_facility = undef,
|
||||
Optional[Swift::LogLevel] $log_level = undef,
|
||||
$log_headers = $facts['os_service_default'],
|
||||
$log_address = $facts['os_service_default'],
|
||||
$storage_domain = $facts['os_service_default'],
|
||||
@@ -83,11 +83,20 @@ class swift::proxy::domain_remap (
|
||||
|
||||
$reseller_prefixes_real = join(any2array($reseller_prefixes), ',')
|
||||
|
||||
$log_facility_real = $log_facility ? {
|
||||
undef => $facts['os_service_default'],
|
||||
default => $log_facility,
|
||||
}
|
||||
$log_level_real = $log_level ? {
|
||||
undef => $facts['os_service_default'],
|
||||
default => $log_level,
|
||||
}
|
||||
|
||||
swift_proxy_config {
|
||||
'filter:domain_remap/use': value => 'egg:swift#domain_remap';
|
||||
'filter:domain_remap/set log_name': value => $log_name;
|
||||
'filter:domain_remap/set log_facility': value => $log_facility;
|
||||
'filter:domain_remap/set log_level': value => $log_level;
|
||||
'filter:domain_remap/set log_facility': value => $log_facility_real;
|
||||
'filter:domain_remap/set log_level': value => $log_level_real;
|
||||
'filter:domain_remap/set log_headers': value => $log_headers;
|
||||
'filter:domain_remap/set log_address': value => $log_address;
|
||||
'filter:domain_remap/storage_domain' : value => $storage_domain;
|
||||
|
@@ -49,8 +49,8 @@ class swift::proxy::gatekeeper (
|
||||
$shunt_inbound_x_timestamp = $facts['os_service_default'],
|
||||
$allow_reserved_names_header = $facts['os_service_default'],
|
||||
$log_name = 'gatekeeper',
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
$log_level = 'INFO',
|
||||
Swift::LogFacility $log_facility = 'LOG_LOCAL2',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
$log_headers = $facts['os_service_default'],
|
||||
$log_address = '/dev/log'
|
||||
) {
|
||||
|
@@ -150,8 +150,8 @@ class swift::storage::all (
|
||||
$container_pipeline = undef,
|
||||
$account_pipeline = undef,
|
||||
$mount_check = true,
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
$log_level = 'INFO',
|
||||
Swift::LogFacility $log_facility = 'LOG_LOCAL2',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
Boolean $log_name_per_daemon = false,
|
||||
$log_udp_host = undef,
|
||||
$log_udp_port = undef,
|
||||
|
@@ -110,10 +110,10 @@ class swift::storage::drive_audit (
|
||||
$weekday = '*',
|
||||
Integer[0] $maxdelay = 0,
|
||||
# drive-audit.conf options
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
$log_level = 'INFO',
|
||||
$log_address = '/dev/log',
|
||||
$log_name = 'drive-audit',
|
||||
Swift::LogFacility $log_facility = 'LOG_LOCAL2',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
String[1] $log_address = '/dev/log',
|
||||
String[1] $log_name = 'drive-audit',
|
||||
$log_udp_host = $facts['os_service_default'],
|
||||
$log_udp_port = $facts['os_service_default'],
|
||||
$log_max_line_length = $facts['os_service_default'],
|
||||
|
@@ -329,10 +329,10 @@ define swift::storage::server (
|
||||
$reaper_interval = $facts['os_service_default'],
|
||||
$reaper_conn_timeout = $facts['os_service_default'],
|
||||
$reaper_node_timeout = $facts['os_service_default'],
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
$log_level = 'INFO',
|
||||
$log_address = '/dev/log',
|
||||
$log_name = "${type}-server",
|
||||
Swift::LogFacility $log_facility = 'LOG_LOCAL2',
|
||||
Swift::LogLevel $log_level = 'INFO',
|
||||
String[1] $log_address = '/dev/log',
|
||||
String[1] $log_name = "${type}-server",
|
||||
Boolean $log_name_per_daemon = false,
|
||||
$log_udp_host = $facts['os_service_default'],
|
||||
$log_udp_port = $facts['os_service_default'],
|
||||
|
@@ -23,7 +23,7 @@ describe 'swift::proxy::cname_lookup' do
|
||||
{
|
||||
:log_name => 'newcname_lookup',
|
||||
:log_facility => 'LOG_LOCAL3',
|
||||
:log_level => 'WARN',
|
||||
:log_level => 'WARNING',
|
||||
:log_headers => 'True',
|
||||
:log_address => '/var/log',
|
||||
:storage_domain => 'example.com',
|
||||
@@ -34,7 +34,7 @@ describe 'swift::proxy::cname_lookup' do
|
||||
|
||||
it { is_expected.to contain_swift_proxy_config('filter:cname_lookup/set log_name').with_value('newcname_lookup') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:cname_lookup/set log_facility').with_value('LOG_LOCAL3') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:cname_lookup/set log_level').with_value('WARN') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:cname_lookup/set log_level').with_value('WARNING') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:cname_lookup/set log_headers').with_value('True') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:cname_lookup/set log_address').with_value('/var/log') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:cname_lookup/storage_domain').with_value('example.com') }
|
||||
|
@@ -21,7 +21,7 @@ describe 'swift::proxy::domain_remap' do
|
||||
{
|
||||
:log_name => 'newdomain_remap',
|
||||
:log_facility => 'LOG_LOCAL3',
|
||||
:log_level => 'WARN',
|
||||
:log_level => 'WARNING',
|
||||
:log_headers => 'True',
|
||||
:log_address => '/var/log',
|
||||
:storage_domain => 'example.com',
|
||||
@@ -34,7 +34,7 @@ describe 'swift::proxy::domain_remap' do
|
||||
|
||||
it { is_expected.to contain_swift_proxy_config('filter:domain_remap/set log_name').with_value('newdomain_remap') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:domain_remap/set log_facility').with_value('LOG_LOCAL3') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:domain_remap/set log_level').with_value('WARN') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:domain_remap/set log_level').with_value('WARNING') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:domain_remap/set log_headers').with_value('True') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:domain_remap/set log_address').with_value('/var/log') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:domain_remap/storage_domain').with_value('example.com') }
|
||||
|
@@ -21,7 +21,7 @@ describe 'swift::proxy::gatekeeper' do
|
||||
:log_name => 'newgatekeeper',
|
||||
:log_headers => false,
|
||||
:log_facility => 'LOG_LOCAL3',
|
||||
:log_level => 'WARN',
|
||||
:log_level => 'WARNING',
|
||||
}
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ describe 'swift::proxy::gatekeeper' do
|
||||
it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/allow_reserved_names_header').with_value(false) }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_name').with_value('newgatekeeper') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_facility').with_value('LOG_LOCAL3') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_level').with_value('WARN') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_level').with_value('WARNING') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:gatekeeper/set log_headers').with_value(false) }
|
||||
end
|
||||
end
|
||||
|
10
types/logfacility.pp
Normal file
10
types/logfacility.pp
Normal file
@@ -0,0 +1,10 @@
|
||||
type Swift::Logfacility = Enum[
|
||||
'LOG_LOCAL0',
|
||||
'LOG_LOCAL1',
|
||||
'LOG_LOCAL2',
|
||||
'LOG_LOCAL3',
|
||||
'LOG_LOCAL4',
|
||||
'LOG_LOCAL5',
|
||||
'LOG_LOCAL6',
|
||||
'LOG_LOCAL7',
|
||||
]
|
9
types/loglevel.pp
Normal file
9
types/loglevel.pp
Normal file
@@ -0,0 +1,9 @@
|
||||
type Swift::LogLevel = Enum[
|
||||
'DEBUG',
|
||||
'INFO',
|
||||
'WARNING',
|
||||
'WARN',
|
||||
'ERROR',
|
||||
'CRITICAL',
|
||||
'FATAL',
|
||||
]
|
Reference in New Issue
Block a user