class ntpd {
package { ntp : ensure => latest }
file { "/etc/ntp.conf":
owner => root,
group => root,
mode => 644,
require => Package["ntp"],
source => [
"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 => [
"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",
nagios_plugin => "nagios-plugins-ntp",
}
}
class ntpd::time_master inherits ntpd {
File["/etc/ntp.conf"] {
source => [
"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 => [
"puppet:///ntpd/step-tickers-$hostname",
"puppet:///ntpd/step-tickers-$gateway.conf",
"puppet:///ntpd/step-tickers-$zone.conf",
"puppet:///ntpd/step-tickers-time-master",
]
}
}