X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fntp%2Fmanifests%2Finit.pp;h=018e5fcbc72b4188cb8bcc9bbe50e930d2e921a2;hb=828fd5cab8e07c1dba361e49838294d6df38030d;hp=1b02a836050c2e00d1abaf5a04b1eed70de32f2d;hpb=0b1ec2d7f59d27596ebc1f2ecf30a900dbdad7da;p=mirror%2Fdsa-puppet.git diff --git a/modules/ntp/manifests/init.pp b/modules/ntp/manifests/init.pp index 1b02a8360..018e5fcbc 100644 --- a/modules/ntp/manifests/init.pp +++ b/modules/ntp/manifests/init.pp @@ -1,14 +1,53 @@ class ntp { - package { ntp: ensure => installed } - file { "/var/lib/ntp/": + package { 'ntp': + ensure => installed + } + + service { 'ntp': + ensure => running, + require => Package['ntp'] + } + + ferm::rule { 'dsa-ntp': + domain => '(ip ip6)', + description => 'Allow ntp access', + rule => '&SERVICE(udp, 123)' + } + + file { '/etc/init.d/ntp': + source => 'puppet:///modules/ntp/ntp.init', + mode => '0555', + notify => Exec['systemctl daemon-reload'], + } + file { '/var/lib/ntp': ensure => directory, owner => ntp, group => ntp, - mode => 755 - ; + mode => '0755', + require => Package['ntp'] + } + file { '/etc/ntp.conf': + content => template('ntp/ntp.conf'), + notify => Service['ntp'], + require => Package['ntp'], + } + file { '/etc/ntp.keys.d': + ensure => directory, + group => 'ntp', + mode => '0750', + notify => Service['ntp'], + require => Package['ntp'], + } + + munin::check { [ + 'ntp_offset', + 'ntp_states', + ]: } - exec { "ntp restart": - path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin", - refreshonly => true, + + if getfromhash($deprecated::nodeinfo, 'timeserver') { + include ntp::timeserver + } else { + include ntp::client } }