
Final multi-OS Puppet manifest for NTP
By:
slowe on
Jul 5th, 2012 | syntax:
None | size: 1.14 KB | hits: 96 | expires: Never
# NTP class definition
class ntp {
include "ntp::$operatingsystem"
}
class ntp::common {
file { "ntp.conf":
path => "/etc/ntp.conf",
owner => "root",
group => "root",
mode => 644,
source => "puppet://puppetmaster/files/ntp.conf",
require => Package["ntp"],
}
package { "ntp":
ensure => installed,
}
service { "ntp":
subscribe => File["ntp.conf"],
require => File["ntp.conf"],
ensure => running,
}
}
class ntp::openbsd inherits ntp::common {
File["ntp.conf"] {
path => "/etc/ntpd.conf",
group => "wheel",
source => "puppet://puppetmaster/files/ntpd.conf.$operatingsystem",
}
Package["ntp"] {
source => "http://openbsd.mirrorcatalogs.com/pub/OpenBSD/5.1/packages/i386/",
}
Service["ntp"] {
provider => "base",
hasstatus => "false",
start => "/usr/sbin/ntpd",
}
}
class ntp::ubuntu inherits ntp::common {
Service["ntp"] {
provider => "init",
path => "/etc/init.d/",
}
}