summaryrefslogtreecommitdiff
path: root/manifests/ntpdate.pp
blob: d9b7bd8c01806229847337cf917afd361b9c4dea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class ntp::ntpdate(
  $pool = lookup('ntp::pool', undef, undef, '')
) {
  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"],
  }
}