]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ntp/manifests/init.pp
af086f6849edc5621f6c8d2fc621e3c7357c8af5
[dsa-puppet.git] / modules / ntp / manifests / init.pp
1 class ntp {
2         package { ntp: ensure => installed }
3         file {  "/var/lib/ntp/":
4                         ensure  => directory,
5                         owner   => ntp,
6                         group   => ntp,
7                         mode    => 755
8                         ;
9                 "/var/lib/ntpstats":
10                         ensure  => directory,
11                         owner   => ntp,
12                         group   => ntp,
13                         mode    => 755
14                         ;
15                 "/etc/ntp.conf":
16                         owner   => root,
17                         group   => root,
18                         mode    => 444,
19                         content => template("ntp/ntp.conf"),
20                         notify  => Exec["ntp restart"],
21                         require => Package["ntp"]
22                         ;
23         }
24         exec { "ntp restart":
25                 path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
26                 refreshonly => true,
27         }
28         @ferm::rule { "dsa-ntp":
29                 domain          => "(ip ip6)",
30                 description     => "Allow ntp access",
31                 rule            => "&SERVICE(udp, 123)"
32         }
33 }