Closed jcpunk closed 1 month ago
I almost went with
if $set_local_rtc {
exec { 'set local hardware clock to local time':
command => 'timedatectl set-local-rtc 1',
onlyif => 'test $(timedatectl show | grep LocalRTC | cut -d= -f2) = no',
path => $facts['path'],
}
} else {
exec { 'set local hardware clock to UTC time':
command => 'timedatectl set-local-rtc 0',
unless => 'test $(timedatectl show | grep LocalRTC | cut -d= -f2) = no',
path => $facts['path'],
}
}
But that make the hardware clock explicitly managed when it wasn't before. I don't believe localtime is rational for POSIX system, but I'm not sure just pushing that on folks is the right call.
I would have preferred systemd::timedatectl
to be not funneled through the main class, then the params could be non-optional. But the whole module is designed in that way, and others have different opinions on that ;)
So LGTM...
Changes merged.
In theory this is sorted.
Pull Request (PR) description
Add support for timedatectl to set timezone and hardware clock
This Pull Request (PR) fixes the following issues
Fixes: #377