Skip to content

Commit 84da553

Browse files
zipkidekohl
authored andcommitted
Add timezone param for systemd.timer
1 parent 8e8793c commit 84da553

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

manifests/agent/service.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
contain puppet::agent::service::daemon
3838

3939
class { 'puppet::agent::service::systemd':
40-
enabled => $systemd_enabled,
41-
hour => $puppet::run_hour,
42-
minute => $puppet::run_minute,
40+
enabled => $systemd_enabled,
41+
hour => $puppet::run_hour,
42+
minute => $puppet::run_minute,
43+
timezone => $puppet::run_timezone,
4344
}
4445
contain puppet::agent::service::systemd
4546

manifests/agent/service/systemd.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Boolean $enabled = false,
55
Optional[Integer[0,23]] $hour = undef,
66
Variant[Integer[0,59], Array[Integer[0,59]], Undef] $minute = undef,
7+
Optional[String] $timezone = undef,
78
) {
89
unless $puppet::runmode == 'unmanaged' or 'systemd.timer' in $puppet::unavailable_runmodes {
910
# Use the same times as for cron

manifests/init.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
# $run_minute:: The minute at which to run the puppet agent
7373
# when runmode is cron or systemd.timer.
7474
#
75+
# $run_timezone:: The timezon for the run the puppet agent
76+
# when runmode is systemd.timer.
77+
# Use `timedatectl list-timezones` to list accepted values
78+
#
7579
# $cron_cmd:: Specify command to launch when runmode is
7680
# set 'cron'.
7781
#
@@ -605,6 +609,7 @@
605609
Enum['cron', 'service', 'systemd.timer', 'none', 'unmanaged'] $runmode = $puppet::params::runmode,
606610
Optional[Integer[0,23]] $run_hour = undef,
607611
Variant[Integer[0,59], Array[Integer[0,59]], Undef] $run_minute = undef,
612+
Optional[String] $run_timezone = undef,
608613
Array[Enum['cron', 'service', 'systemd.timer', 'none']] $unavailable_runmodes = $puppet::params::unavailable_runmodes,
609614
Optional[String] $cron_cmd = $puppet::params::cron_cmd,
610615
Optional[String] $systemd_cmd = $puppet::params::systemd_cmd,

templates/agent/systemd.puppet-run.timer.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Description=Systemd Timer for Puppet Agent
66

77
[Timer]
8-
OnCalendar=*-*-* <%= Array(@_hour).join(',') %>:<%= Array(@_minute).join(',') %>:00
8+
OnCalendar=*-*-* <%= Array(@_hour).join(',') %>:<%= Array(@_minute).join(',') %>:00 <%= @timezone %>
99
Persistent=true
1010
RandomizedDelaySec=<%= @randomizeddelaysec %>
1111

0 commit comments

Comments
 (0)