Try to avoid reserved site keyword
[mirror/dsa-puppet.git] / modules / ntp / manifests / init.pp
1 class ntp {
2         package { 'ntp':
3                 ensure => installed
4         }
5
6         service { 'ntp':
7                 ensure  => running,
8                 require => Package['ntp']
9         }
10
11         ferm::rule { 'dsa-ntp':
12                 domain      => '(ip ip6)',
13                 description => 'Allow ntp access',
14                 rule        => '&SERVICE(udp, 123)'
15         }
16
17         file { '/etc/init.d/ntp':
18                 source => 'puppet:///modules/ntp/ntp.init',
19                 mode   => '0555',
20                 notify => Exec['systemctl daemon-reload'],
21         }
22         file { '/var/lib/ntp':
23                 ensure  => directory,
24                 owner   => ntp,
25                 group   => ntp,
26                 mode    => '0755',
27                 require => Package['ntp']
28         }
29         file { '/etc/ntp.conf':
30                 content => template('ntp/ntp.conf'),
31                 notify  => Service['ntp'],
32                 require => Package['ntp'],
33         }
34         file { '/etc/ntp.keys.d':
35                 ensure  => directory,
36                 group   => 'ntp',
37                 mode    => '0750',
38                 notify  => Service['ntp'],
39                 require => Package['ntp'],
40         }
41
42         munin::check { [
43                         'ntp_offset',
44                         'ntp_states',
45                         ]:
46         }
47
48         if getfromhash($deprecated::nodeinfo, 'timeserver') {
49                 include ntp::timeserver
50         } else {
51                 include ntp::client
52         }
53 }