diff --git a/REFERENCE.md b/REFERENCE.md index 934b29e..3a4ac49 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -26,6 +26,7 @@ Configures IcingaDB ### Data types +* [`IcingaDB::LoggingOptions`](#IcingaDB--LoggingOptions): Logging options data type for the IcingaDB process. * [`IcingaDB::RetentionOptions`](#IcingaDB--RetentionOptions): Data type for retention options of the connection to the IcingaDB database. * [`IcingaDB::DBOptions`](#IcingaDB--DBOptions): Data type for options to connect the IcingaDB database. @@ -367,16 +368,7 @@ Default value: `'20s'` ##### `logging_options` -Data type: - -```puppet -Hash[Enum[ - 'config-sync','database','dump-signals', - 'heartbeat','high-availability', - 'history-sync','overdue-sync','redis', - 'retention','runtime-updates','telemetry' - ],Enum['fatal','error','warn','info','debug']] -``` +Data type: `IcingaDB::LoggingOptions` Map of component-logging level pairs to define a different log level than the default value for each component. @@ -750,6 +742,10 @@ Data type: `Stdlib::Absolutepath` ## Data types +### `IcingaDB::LoggingOptions` + +Logging options data type for the IcingaDB process. + ### `IcingaDB::RetentionOptions` Data type for retention options of the connection to @@ -763,8 +759,10 @@ Alias of ```puppet Hash[Enum[ - 'acknowledgement','comment','downtime', - 'flapping','notification','state' - ], Integer[1]] + 'config-sync','database','dump-signals', + 'heartbeat','high-availability', + 'history-sync','overdue-sync','redis', + 'retention','runtime-updates','telemetry' + ], Enum['fatal','error','warn','info','debug']] ``` diff --git a/manifests/init.pp b/manifests/init.pp index 10617e6..f1616df 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -163,12 +163,7 @@ Optional[Stdlib::Absolutepath] $redis_tls_cacert_file = undef, Enum['fatal','error','warn','info','debug'] $logging_level = 'info', Optional[Enum['console','systemd-journald']] $logging_output = undef, - Hash[Enum[ - 'config-sync','database','dump-signals', - 'heartbeat','high-availability', - 'history-sync','overdue-sync','redis', - 'retention','runtime-updates','telemetry' - ],Enum['fatal','error','warn','info','debug']] $logging_options = {}, + IcingaDB::LoggingOptions $logging_options = {}, Pattern[/^\d+\.?\d*[d|h|m|s]?$/] $logging_interval = '20s', Optional[Integer[1]] $retention_history_data = undef, Optional[Integer[1]] $retention_sla_data = undef, diff --git a/types/loggingoptions.pp b/types/loggingoptions.pp new file mode 100644 index 0000000..f4fc07e --- /dev/null +++ b/types/loggingoptions.pp @@ -0,0 +1,12 @@ +# @summary +# Logging options data type for the IcingaDB process. +# +type IcingaDB::LoggingOptions = Hash[ + Enum[ + 'config-sync','database','dump-signals', + 'heartbeat','high-availability', + 'history-sync','overdue-sync','redis', + 'retention','runtime-updates','telemetry' + ], + Enum['fatal','error','warn','info','debug'] +]