From be2a45c7f834c3ff665d7ca5eba2204bb54c0442 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Sun, 4 Oct 2026 15:29:30 +0200 Subject: [PATCH] OP#830 add loki management --- manifests/main/config.pp | 4 ++++ manifests/monitoring/loki.pp | 14 ++++++++++++++ manifests/params.pp | 4 ++++ 3 files changed, 22 insertions(+) create mode 100644 manifests/monitoring/loki.pp diff --git a/manifests/main/config.pp b/manifests/main/config.pp index 3736081..4239673 100644 --- a/manifests/main/config.pp +++ b/manifests/main/config.pp @@ -11,4 +11,8 @@ class confdroid_ntp::main::config ( if $cy_manage_nagios == true { include confdroid_ntp::monitoring::target } + + if $cy_manage_loki == true { + include confdroid_ntp::monitoring::loki + } } diff --git a/manifests/monitoring/loki.pp b/manifests/monitoring/loki.pp new file mode 100644 index 0000000..f1c24eb --- /dev/null +++ b/manifests/monitoring/loki.pp @@ -0,0 +1,14 @@ +#### confdroid_ntp::monitoring::loki.pp +# Module name: confdroid_ntp +# Author: 12ww1160 (12ww1160@confdroid.com) +# @summary Class manages loki monitoring for the confdroid_ntp services +############################################################################### +class confdroid_ntp::monitoring::loki ( + +) inherits confdroid_ntp::params { + if $cy_manage_loki == true { + confdroid_loki::log_targets { "confdroid_ntp_${fqdn}": + log_target => ['/var/log/chrony/*.log'], + } + } +} diff --git a/manifests/params.pp b/manifests/params.pp index f8a0116..d2407aa 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -23,6 +23,7 @@ # @param [String] cy_target_service Path to the Nagios service configuration file. # @param [Array] cy_target_contacts List of Nagios contacts for notifications. # must exist in Nagios contacts configuration! +# @param [Boolean] cy_manage_loki Whether to manage Loki logging for the module. ############################################################################### class confdroid_ntp::params ( @@ -46,6 +47,9 @@ class confdroid_ntp::params ( String $cy_target_service = '/etc/nagios/conf.d/chronyd_service.cfg', Array $cy_target_contacts = ['nagiosadmin'], +# loki + Boolean $cy_manage_loki = false, + ) { # facts $fqdn = $facts['networking']['fqdn']