Files
confdroid_ntp/manifests/params.pp
2026-10-04 15:29:30 +02:00

75 lines
3.2 KiB
Puppet

## confdroid_ntp::params.pp
# Module name: confdroid_ntp
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class contains all parameters for the confdroid_ntp module.
# @param [Array] cy_reqpackages List of required packages to install
# for the confdroid_ntp module.
# @param [String] cy_pkg_ensure Ensure state of the required packages.
# @param [String] cy_server_fqdn FQDN of the NTP server to configure.
# If the fqdn of the host matches this value, a time server will be
# configured, else a client.
# @param [Array] cy_conf_servers List of NTP servers to point to as time source
# @param [String] cy_min_sources Minimum number of selectable sources required
# to adjust the system clock. Primarily used for servers.
# @param [String] cy_client_allow CIDR notation for allowed client networks
# @param [String] cy_leapsec_mode Leap second handling mode. Valid values are
# 'slew' or 'step'.
# @param [String] cy_leapsectz Leap second timezone file to use.
# @param [String] cy_loginfo Log information to record. Valid values are
# 'measurements', 'statistics', and 'tracking'.
# @param [Boolean] cy_use_lan_server Whether to use a local LAN server or external pool.
# @param [Boolean] cy_manage_nagios Whether to manage Nagios monitoring for the module.
# @param [String] cy_procs_allowed Number of allowed processes for the Nagios check.
# @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 (
# installation
Array $cy_reqpackages = ['chrony'],
String $cy_pkg_ensure = 'present',
# configuration
Boolean $cy_use_lan_server = false,
String $cy_server_fqdn = 'ntp.example.local',
Array $cy_conf_servers = ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
String $cy_min_sources = '3',
String $cy_client_allow = '192.168.1.0/24',
String $cy_leapsec_mode = 'slew',
String $cy_leapsectz = 'right/UTC',
String $cy_loginfo = 'measurements statistics tracking',
# monitoring
Boolean $cy_manage_nagios = false,
String $cy_procs_allowed = '1:',
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']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
# dirs
# files
$cy_conf_file = '/etc/chrony.conf'
$cy_conf_erb = 'confdroid_ntp/chrony.conf.erb'
$cy_drift_file = '/var/lib/chrony/drift'
$cy_logrotate_file = '/etc/logrotate.d/chrony'
$cy_logrotate_erb = 'confdroid_ntp/logrotate.chrony.erb'
# service
$cy_service = 'chronyd'
# includes must be last
include confdroid_ntp::main::config
}