Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/windowstime/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@
}

if $timezone {
validate_legacy(String, 'validate_re', $timezone, $timezones, 'The specified string is not a valid Timezone')
# Native validation (no stdlib validate_legacy / validate_re).
# If timezones is provided (and non-empty), require timezone be one of them.
if $timezones and $timezones != [] {
unless $timezone in $timezones {
fail('The specified string is not a valid Timezone')
}
}

if $timezone != $facts['timezone'] {
$system32dir = $facts['os']['windows']['system32']
exec { "${system32dir}\\tzutil.exe /s \"${timezone}\"":
Expand Down