2026-10-01 13:30:42 +02:00
|
|
|
## confdroid_ntp::params.pp
|
|
|
|
|
# Module name: confdroid_ntp
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
|
|
|
|
# @summary Class contains all parameters for the confdroid_ntp module.
|
2026-10-01 13:52:10 +02:00
|
|
|
# @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.
|
2026-10-02 13:32:06 +02:00
|
|
|
# @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
|
2026-10-02 15:37:23 +02:00
|
|
|
# @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
|
2026-10-02 15:48:36 +02:00
|
|
|
# @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'.
|
2026-10-02 16:03:13 +02:00
|
|
|
# @param [Boolean] cy_use_lan_server Whether to use a local LAN server or external pool.
|
2026-10-02 13:32:06 +02:00
|
|
|
###############################################################################
|
2026-10-01 13:30:42 +02:00
|
|
|
class confdroid_ntp::params (
|
2026-10-01 13:52:10 +02:00
|
|
|
|
|
|
|
|
# installation
|
2026-10-02 16:03:13 +02:00
|
|
|
Array $cy_reqpackages = ['chrony'],
|
|
|
|
|
String $cy_pkg_ensure = 'present',
|
2026-10-02 12:57:28 +02:00
|
|
|
|
|
|
|
|
# configuration
|
2026-10-02 16:03:13 +02:00
|
|
|
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',
|
2026-10-01 13:52:10 +02:00
|
|
|
|
2026-10-01 13:30:42 +02:00
|
|
|
) {
|
2026-10-02 13:58:42 +02:00
|
|
|
# facts
|
2026-10-02 16:03:13 +02:00
|
|
|
$fqdn = $facts['networking']['fqdn']
|
|
|
|
|
$domain = $facts['networking']['domain']
|
|
|
|
|
$os_name = $facts['os']['name']
|
|
|
|
|
$os_release = $facts['os']['release']['major']
|
2026-10-01 13:30:42 +02:00
|
|
|
|
2026-10-01 14:14:07 +02:00
|
|
|
# dirs
|
|
|
|
|
|
|
|
|
|
# files
|
2026-10-02 16:03:13 +02:00
|
|
|
$cy_conf_file = '/etc/chrony.conf'
|
|
|
|
|
$cy_conf_erb = 'confdroid_ntp/chrony.conf.erb'
|
2026-10-04 12:09:10 +02:00
|
|
|
$cy_drift_file = '/var/lib/chrony/drift'
|
2026-10-01 14:14:07 +02:00
|
|
|
|
|
|
|
|
# service
|
2026-10-02 16:03:13 +02:00
|
|
|
$cy_service = 'chronyd'
|
2026-10-01 14:14:07 +02:00
|
|
|
|
2026-10-01 13:30:42 +02:00
|
|
|
# includes must be last
|
|
|
|
|
include confdroid_ntp::main::config
|
|
|
|
|
}
|