Don't like ads? PRO users don't see any ads ;-)

Final multi-OS Puppet manifest for NTP

By: slowe on Jul 5th, 2012  |  syntax: None  |  size: 1.14 KB  |  hits: 96  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # NTP class definition
  2.  
  3. class ntp {
  4.   include "ntp::$operatingsystem"
  5. }
  6.  
  7. class ntp::common {
  8.   file { "ntp.conf":
  9.     path          => "/etc/ntp.conf",
  10.     owner         => "root",
  11.     group         => "root",
  12.     mode          => 644,
  13.     source        => "puppet://puppetmaster/files/ntp.conf",
  14.     require       => Package["ntp"],
  15.   }
  16.  
  17.   package { "ntp":
  18.     ensure        => installed,
  19.   }
  20.  
  21.   service { "ntp":
  22.     subscribe     => File["ntp.conf"],
  23.     require       => File["ntp.conf"],
  24.     ensure        => running,
  25.   }
  26. }
  27.  
  28. class ntp::openbsd inherits ntp::common {
  29.   File["ntp.conf"] {
  30.     path          => "/etc/ntpd.conf",
  31.     group         => "wheel",
  32.     source        => "puppet://puppetmaster/files/ntpd.conf.$operatingsystem",
  33.   }
  34.  
  35.   Package["ntp"] {
  36.     source        => "http://openbsd.mirrorcatalogs.com/pub/OpenBSD/5.1/packages/i386/",
  37.   }
  38.  
  39.   Service["ntp"] {
  40.     provider      => "base",
  41.     hasstatus     => "false",
  42.     start         => "/usr/sbin/ntpd",
  43.   }
  44. }
  45.  
  46. class ntp::ubuntu inherits ntp::common {
  47.   Service["ntp"] {
  48.     provider      => "init",
  49.     path          => "/etc/init.d/",
  50.   }
  51. }