Report abuse

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class ntp-client {
        $ntp_conf_framework = "restrict 127.0.0.1
restrict default kod nomodify notrap
server ntp1.$domain
server ntp2.$domain
server ntp3.$domain
driftfile /var/lib/ntp/drift\n"

        $ntp = $operatingsystem ? {
                default => ntp,
        }
        package { $ntp:
                ensure => installed,
                alias => ntp,
        }
        file { "ntp.conf":
                path => $operatingsystem ? {
                        default => "/etc/ntp.conf",
                },
                content => $virtual ? {
                        vmware => "tinker panic 0\n$ntp_conf_framework\n",
                        default => "$ntp_conf_framework\n",
                },
                mode => 644,
                alias => "ntp.conf",
                backup => ".puppet-backup",
        }
        file { step-tickers:
                path => $operatingsystem ? {
                        default => "/etc/ntp/step-tickers",
                },
                content => "ntp1.$domain\nntp2.$domain\nntp3.$domain\n",
                mode => 420,
                backup => ".puppet-backup",
        }
        service { ntpd:
                enable => true,
                ensure => running,
                hasrestart => true,
                hasstatus => true,
                subscribe => [File["ntp.conf"], Package["ntp"]]
        }
}