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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# NTP daemon configuration classes 
# vim:ts=4:expandtab
# $Id: init.pp 129 2009-04-15 07:04:12Z paulway $

class ntpd {
    package { ntp : ensure => latest }

    file { "/etc/ntp.conf":
        owner   => root,
        group   => root,
        mode    => 644,
        require => Package["ntp"],
        source  => [ # In decreasing order of specificity
            "puppet:///ntpd/ntp-$hostname.conf",
            "puppet:///ntpd/ntp-$gateway.conf",
            "puppet:///ntpd/ntp-$zone.conf",
            "puppet:///ntpd/ntp.conf",
        ]
    }

    file { "/etc/ntp/step-tickers":
        owner   => root,
        group   => root,
        mode    => 644,
        source  => [ # In decreasing order of specificity
            "puppet:///ntpd/step-tickers-$hostname",
            "puppet:///ntpd/step-tickers-$gateway.conf",
            "puppet:///ntpd/step-tickers-$zone.conf",
            "puppet:///ntpd/step-tickers",
        ]
    }

    service { "ntpd":
        subscribe   => [Package[ntp], File["/etc/ntp.conf"]],
        ensure      => running,
    }

    nagios::nrpe_command { "check_time":
        command     => "check_ntp",
        parameters  => "-H localhost", # local to remote server
        nagios_plugin => "nagios-plugins-ntp",
    }
}

class ntpd::time_master inherits ntpd {

    File["/etc/ntp.conf"] { 
        source  => [ # In decreasing order of specificity
            "puppet:///ntpd/ntp-$hostname.conf",
            "puppet:///ntpd/ntp-$gateway.conf",
            "puppet:///ntpd/ntp-$zone.conf",
            "puppet:///ntpd/ntp-time-master.conf",
        ]
    }

    File["/etc/ntp/step-tickers"] {
        source  => [ # In decreasing order of specificity
            "puppet:///ntpd/step-tickers-$hostname",
            "puppet:///ntpd/step-tickers-$gateway.conf",
            "puppet:///ntpd/step-tickers-$zone.conf",
            "puppet:///ntpd/step-tickers-time-master",
        ]
    }

}