add define for logs

This commit is contained in:
2026-10-04 15:13:44 +02:00
parent 5d2047a77e
commit 77258a537e
6 changed files with 139 additions and 88 deletions

20
manifests/log_targets.pp Normal file
View File

@@ -0,0 +1,20 @@
## confdroid_alloy::log_targets.pp
# Module name: confdroid_alloy
# @summary Adds log file targets to the Alloy configuration.
# @param [Array[String]] targets Paths to log files to scrape.
###############################################################################
define confdroid_alloy::log_targets (
Array[String] $targets = [],
) {
if $confdroid_alloy::params::ay_manage_loki == true and $targets != [] {
$log_targets_array = $targets
concat::fragment { "log_targets_${name}":
target => $confdroid_alloy::params::ay_main_file,
content => template('confdroid_alloy/log_targets.alloy.erb'),
order => '020',
}
}
}