From 3ff46811632a41727c14105a55f8654194b1eab0 Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Sun, 31 Dec 2023 11:23:59 +0100 Subject: [PATCH] Set logging_type to syslog on Linux platforms by default --- REFERENCE.md | 6 ------ data/Linux-kernel.yaml | 4 ++++ data/common.yaml | 5 +++++ manifests/agent.pp | 2 +- manifests/server.pp | 2 +- manifests/worker.pp | 2 +- spec/classes/agent_spec.rb | 2 +- spec/classes/server_spec.rb | 4 ++-- spec/classes/worker_spec.rb | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 5f6e635..841ca6d 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -116,8 +116,6 @@ Data type: `Enum['file', 'syslog', 'eventlog']` Switch the log target. On Windows `syslog` is ignored, `eventlog` on all other platforms. -Default value: `'file'` - ##### `logging_level` Data type: `Icinga::LogLevel` @@ -708,8 +706,6 @@ Data type: `Enum['file', 'syslog', 'eventlog']` Switch the log target. On Windows `syslog` is ignored, `eventlog` on all other platforms. -Default value: `'file'` - ##### `logging_level` Data type: `Icinga::LogLevel` @@ -1831,8 +1827,6 @@ Data type: `Enum['file', 'syslog', 'eventlog']` Switch the log target. On Windows `syslog` is ignored, `eventlog` on all other platforms. -Default value: `'file'` - ##### `logging_level` Data type: `Icinga::LogLevel` diff --git a/data/Linux-kernel.yaml b/data/Linux-kernel.yaml index 3725841..1bad725 100644 --- a/data/Linux-kernel.yaml +++ b/data/Linux-kernel.yaml @@ -11,3 +11,7 @@ icinga::redis::globals::user: icinga-redis icinga::redis::globals::group: icinga-redis icinga::web::apache_cgi_pass_auth: true + +icinga::server::logging_type: syslog +icinga::worker::logging_type: syslog +icinga::agent::logging_type: syslog diff --git a/data/common.yaml b/data/common.yaml index ea66191..369662d 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -10,6 +10,11 @@ icinga::repos::manage_server_monitoring: false icinga::repos::manage_plugins: false icinga::repos::manage_extras: false +icinga::server::logging_type: file icinga::server::logging_level: warning + +icinga::worker::logging_type: file icinga::worker::logging_level: warning + +icinga::agent::logging_type: file icinga::agent::logging_level: warning diff --git a/manifests/agent.pp b/manifests/agent.pp index fe01910..e9c8bb1 100644 --- a/manifests/agent.pp +++ b/manifests/agent.pp @@ -30,9 +30,9 @@ Stdlib::Host $ca_server, Hash[String, Hash] $parent_endpoints, Icinga::LogLevel $logging_level, + Enum['file', 'syslog', 'eventlog'] $logging_type, String $parent_zone = 'main', Array[String] $global_zones = [], - Enum['file', 'syslog', 'eventlog'] $logging_type = 'file', String $zone = 'NodeName', Boolean $run_web = false, ) { diff --git a/manifests/server.pp b/manifests/server.pp index e4001fa..793a929 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -49,6 +49,7 @@ # and add the Icinga user to this group. # class icinga::server ( + Enum['file', 'syslog', 'eventlog'] $logging_type, Icinga::LogLevel $logging_level, Boolean $ca = false, Boolean $config_server = false, @@ -62,7 +63,6 @@ Optional[Icinga::Secret] $web_api_pass = undef, String $director_api_user = 'director', Optional[Icinga::Secret] $director_api_pass = undef, - Enum['file', 'syslog', 'eventlog'] $logging_type = 'file', Boolean $run_web = false, ) { if empty($colocation_endpoints) { diff --git a/manifests/worker.pp b/manifests/worker.pp index cc87e4c..c9cf0a7 100644 --- a/manifests/worker.pp +++ b/manifests/worker.pp @@ -37,12 +37,12 @@ Stdlib::Host $ca_server, String $zone, Hash[String, Hash] $parent_endpoints, + Enum['file', 'syslog', 'eventlog'] $logging_type, Icinga::LogLevel $logging_level, String $parent_zone = 'main', Hash[String, Hash] $colocation_endpoints = {}, Hash[String, Hash] $workers = {}, Array[String] $global_zones = [], - Enum['file', 'syslog', 'eventlog'] $logging_type = 'file', Boolean $run_web = false, ) { # inject parent zone if no parent exists diff --git a/spec/classes/agent_spec.rb b/spec/classes/agent_spec.rb index 53aaf2a..abe9922 100644 --- a/spec/classes/agent_spec.rb +++ b/spec/classes/agent_spec.rb @@ -33,7 +33,7 @@ 'endpoints' => { 'foobar' => { 'host' => '127.0.0.1' } }, }, }, - 'logging_type' => 'file', + 'logging_type' => 'syslog', }, ) } diff --git a/spec/classes/server_spec.rb b/spec/classes/server_spec.rb index d8c6e77..7260e0c 100644 --- a/spec/classes/server_spec.rb +++ b/spec/classes/server_spec.rb @@ -44,7 +44,7 @@ 'endpoints' => { 'NodeName' => {}, }, }, }, - 'logging_type' => 'file', + 'logging_type' => 'syslog', 'ticket_salt' => 'supersecret', }, ) @@ -107,7 +107,7 @@ }, }, }, - 'logging_type' => 'file', + 'logging_type' => 'syslog', 'ticket_salt' => 'supersecret', }, ) diff --git a/spec/classes/worker_spec.rb b/spec/classes/worker_spec.rb index cb624bf..d3ecc8a 100644 --- a/spec/classes/worker_spec.rb +++ b/spec/classes/worker_spec.rb @@ -34,7 +34,7 @@ 'endpoints' => { 'foobar' => { 'host' => '127.0.0.1' } }, }, }, - 'logging_type' => 'file', + 'logging_type' => 'syslog', }, ) }