Skip to content

Commit 85ae56f

Browse files
author
carabasdaniel
authored
Merge pull request #615 from Kristijan/logfile_user_group_perms
Allow setting user and group permissions of the NTP logfile
2 parents eade69f + 31f43c3 commit 85ae56f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

data/common.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ ntp::keys_trusted: []
2626
ntp::keys: []
2727
ntp::leapfile: ~
2828
ntp::logfile: ~
29+
ntp::logfile_user: 'ntp'
2930
ntp::logfile_mode: '0664'
31+
ntp::logfile_group: 'ntp'
3032
ntp::logconfig: ~
3133
ntp::ntpsigndsocket: ~
3234
ntp::maxpoll: ~

manifests/config.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@
139139
if $ntp::logfile {
140140
file { $ntp::logfile:
141141
ensure => file,
142-
owner => 'ntp',
143-
group => 'ntp',
142+
owner => $ntp::logfile_user,
143+
group => $ntp::logfile_group,
144144
mode => $ntp::logfile_mode,
145145
}
146146
}

manifests/init.pp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,16 @@
8787
#
8888
# @param logfile
8989
# Specifies a log file for NTP to use instead of syslog. Default value: ' '.
90-
90+
#
91+
# @param logfile_group
92+
# Specifies the group for the NTP log file. Default is 'ntp'.
93+
#
9194
# @param logfile_mode
9295
# Specifies the permission for the NTP log file. Default is 0664.
9396
#
97+
# @param logfile_user
98+
# Specifies the user for the NTP log file. Default is 'ntp'.
99+
#
94100
# @param logconfig
95101
# Specifies the logconfig for NTP to use. Default value: ' '.
96102
#
@@ -248,7 +254,9 @@
248254
Stdlib::Absolutepath $driftfile,
249255
Optional[Stdlib::Absolutepath] $leapfile,
250256
Optional[Stdlib::Absolutepath] $logfile,
257+
Optional[Variant[String, Integer]] $logfile_group,
251258
String $logfile_mode,
259+
Optional[Variant[String, Integer]] $logfile_user,
252260
Optional[String] $logconfig,
253261
Boolean $iburst_enable,
254262
Array[String] $keys,

0 commit comments

Comments
 (0)