Files
confdroid_alloy/manifests/params.pp

69 lines
3.1 KiB
ObjectPascal
Raw Normal View History

2026-07-21 13:25:48 +02:00
## confdroid_alloy::params.pp
# Module name: confdroid_alloy
# Author: 12ww1160 (12ww1160@confdroid.com)
# @param [String] ay_reqpackages which packages to install
# @param [String] ay_pkg_ensure 'latest' or 'present'
2025-05-06 13:31:39 +02:00
# @param [String] ay_loki_url the url where alloy will send logs to.
# @param [String] ay_loki_username the username to logon to loki
# @param [String] ay_loki_userpass the password to logon to loki
# @param [Boolean] ay_manage_loki whether to manage log forwarding to loki
# @param [Boolean] ay_manage_prom whether to manage metric forwarding
# @param [String] ay_prom_url the url where alloy will send metrics
# @param [Array] ay_log_targets the logging targets
2026-09-01 11:06:14 +02:00
# @param [Boolean] ay_prom_honor_timestamps whether to honor
# timestamps in prometheus metrics
# @param [Boolean] ay_prom_track_timestamps_staleness whether to track timestamps
# staleness in prometheus metrics
2026-09-01 11:34:57 +02:00
# @param [String] ay_prom_max_shards the maximum number of shards to use for prometheus metrics
# @param [String] ay_prom_max_samples_per_send the maximum number of samples to send
# @param [String] ay_prom_batch_send_deadline the maximum time to wait before sending
2026-09-07 13:10:13 +02:00
# @param [Boolean] ay_manage_nagios whether to manage nagios service exports
# @param [String] ay_target_service the target file for nagios service exports
# @param [Array] ay_target_contacts the contacts for nagios service exports
# @param [String] ay_procs_allowed the allowed number of processes for nagios service exports
2026-07-21 13:25:48 +02:00
# @summary Class contains all parameters for the confdroid_alloy module.
2025-02-23 14:34:15 +01:00
##############################################################################
2026-07-21 13:25:48 +02:00
class confdroid_alloy::params (
2025-02-23 14:34:15 +01:00
2026-09-01 11:06:14 +02:00
String $ay_reqpackages = 'alloy',
String $ay_pkg_ensure = 'latest',
2025-02-24 13:24:45 +01:00
# loki
2026-09-01 11:06:14 +02:00
Boolean $ay_manage_loki = true,
String $ay_loki_url = 'https://loki.example.net/loki/api/v1/push',
String $ay_loki_username = 'loki_user',
String $ay_loki_userpass = 'loki_pass',
Array $ay_log_targets = ['/var/log/messages','/var/log/secure',],
2025-02-24 15:23:20 +01:00
# prometheus
2026-09-01 11:06:14 +02:00
Boolean $ay_manage_prom = true,
String $ay_prom_url = 'https://prometheus.example.net/api/v1/write',
Boolean $ay_prom_honor_timestamps = true,
Boolean $ay_prom_track_timestamps_staleness = true,
2026-09-01 11:34:57 +02:00
String $ay_prom_max_shards = '10',
String $ay_prom_max_samples_per_send = '2000',
String $ay_prom_batch_send_deadline = '5s',
2025-06-13 16:05:16 +02:00
2026-09-07 13:10:13 +02:00
# nagios
Boolean $ay_manage_nagios = false,
String $ay_target_service = '/etc/nagios/conf.d/alloy_service.cfg',
Array $ay_target_contacts = ['nagiosadmin'],
String $ay_procs_allowed = '1:'
2026-09-07 13:10:13 +02:00
2025-02-23 14:34:15 +01:00
) {
2026-09-07 13:46:59 +02:00
# defaults
$fqdn = $facts['networking']['fqdn']
2025-03-02 03:22:27 +01:00
# service
$ay_service = 'alloy'
2025-02-23 14:34:15 +01:00
2025-03-02 03:22:27 +01:00
# dirs
$ay_main_dir = '/etc/alloy'
2025-02-24 12:02:24 +01:00
2025-03-02 03:22:27 +01:00
# files
$ay_main_file = "${ay_main_dir}/config.alloy"
2025-02-24 12:02:24 +01:00
2025-02-23 17:02:27 +01:00
# includes must be last
2026-07-21 13:25:48 +02:00
include confdroid_alloy::main::config
2025-02-23 14:34:15 +01:00
}