Skip to content

Commit c1a62c7

Browse files
committed
use ntpsec package on Debian 12 and Ubuntu 24.04
both of these have "ntp" as a transitional package which installs "ntpsec", but setting package_name explicitly is cleaner and allows easier keying of how to configure the system.
1 parent f418701 commit c1a62c7

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

data/Debian-12.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
ntp::package_name:
3+
- ntpsec
4+
ntp::config: '/etc/ntpsec/ntp.conf'

data/Ubuntu-24.04.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
ntp::package_name:
3+
- ntpsec
4+
ntp::config: '/etc/ntpsec/ntp.conf'

manifests/config.pp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@
4444
match => '^RUNASUSER\=',
4545
}
4646
}
47+
}
48+
if 'ntpsec' in $ntp::package_name {
49+
$daemon_config = '/etc/ntpsec/ntp.conf'
4750
} else {
48-
# Assume all other distros in Debian family follow Debian version numbering
49-
if versioncmp($facts['os']['release']['full'], '12') >= 0 {
50-
$daemon_config = '/etc/ntpsec/ntp.conf'
51-
} else {
52-
$daemon_config = '/etc/default/ntp'
53-
}
51+
$daemon_config = '/etc/default/ntp'
5452
}
5553
if $ntp::daemon_extra_opts {
5654
file_line { 'Set NTPD daemon options':

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"operatingsystemrelease": [
5959
"18.04",
6060
"20.04",
61-
"22.04"
61+
"22.04",
62+
"24.04"
6263
]
6364
},
6465
{

0 commit comments

Comments
 (0)