diff options
Diffstat (limited to 'manifests/ntpdate.pp')
-rw-r--r-- | manifests/ntpdate.pp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/manifests/ntpdate.pp b/manifests/ntpdate.pp new file mode 100644 index 0000000..ed858ba --- /dev/null +++ b/manifests/ntpdate.pp @@ -0,0 +1,26 @@ +class ntp::ntpdate( + $pool = hiera('ntp::pool', '') +) { + class { 'ntp::timezone': } + + # TODO: add logrotate rule to /var/log/ntpdate.log + + case $pool { + '': { fail("you need to define ntp::pool for ntp module") } + } + + # the needed packages + package { "ntpdate": + ensure => present, + } + + # adjust time using ntpdate + cron { "ntpdate": + command => "/usr/sbin/ntpdate -t 5 ${pool} >> /var/log/ntpdate.log 2>&1", + user => root, + hour => "*/1", + minute => "10", + ensure => present, + require => Package["ntpdate"], + } +} |