X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fntp%2Fmanifests%2Finit.pp;h=74a5a322e269956643520d40b652b361a410151f;hb=24409d094a53a1ef3c4abeaf707541a00c24f800;hp=00b3340b8bb6d861c8d0fabbc3cd1cdda4fd8bdf;hpb=12c125eacc345b91fb22182272665cf22f00f5e7;p=mirror%2Fdsa-puppet.git diff --git a/modules/ntp/manifests/init.pp b/modules/ntp/manifests/init.pp index 00b3340b8..74a5a322e 100644 --- a/modules/ntp/manifests/init.pp +++ b/modules/ntp/manifests/init.pp @@ -1,32 +1,107 @@ class ntp { - package { ntp: ensure => installed } - file { "/var/lib/ntp/": - ensure => directory, - owner => ntp, - group => ntp, - mode => 755 - ; - "/var/lib/ntpstats": - ensure => directory, - owner => ntp, - group => ntp, - mode => 755 - ; - "/etc/ntp.conf": - owner => root, - group => root, - mode => 444, - content => template("ntp/ntp.conf"), - notify => Exec["ntp restart"], - require => Package["ntp"] - ; - } - exec { "ntp restart": - path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin", - refreshonly => true, - } - ferm::rule { "dsa-ntp": - description => "Allow ntp access", - rule => "proto udp mod state state (NEW) dport (123) ACCEPT" + package { ntp: ensure => installed } + file { + "/var/lib/ntp/": + ensure => directory, + owner => ntp, + group => ntp, + mode => 755, + require => Package["ntp"] + ; + "/var/lib/ntp": + ensure => directory, + owner => ntp, + group => ntp, + mode => 755, + require => Package["ntp"] + ; + "/etc/ntp.conf": + owner => root, + group => root, + mode => 444, + content => template("ntp/ntp.conf"), + notify => Exec["ntp restart"], + require => Package["ntp"] + ; + "/etc/ntp.keys.d": + owner => root, + group => ntp, + mode => 750, + ensure => directory, + require => Package["ntp"] + ; + } + case getfromhash($nodeinfo, 'timeserver') { + true: { + file { + "/var/lib/ntp/leap-seconds.list": + owner => root, + group => root, + mode => 444, + source => [ "puppet:///modules/ntp/leap-seconds.list" ], + require => Package["ntp"], + notify => Exec["ntp restart"], + ; + } } + default: { + file { + "/etc/default/ntp": + owner => root, + group => root, + mode => 444, + source => [ "puppet:///modules/ntp/etc-default-ntp" ], + require => Package["ntp"], + notify => Exec["ntp restart"], + ; + + "/etc/ntp.keys.d/ntpkey_iff_merikanto": + owner => root, + group => root, + mode => 444, + source => [ "puppet:///modules/ntp/ntpkey_iff_merikanto.pub" ], + require => Package["ntp"], + notify => Exec["ntp restart"], + ; + "/etc/ntp.keys.d/ntpkey_iff_orff": + owner => root, + group => root, + mode => 444, + source => [ "puppet:///modules/ntp/ntpkey_iff_orff.pub" ], + require => Package["ntp"], + notify => Exec["ntp restart"], + ; + "/etc/ntp.keys.d/ntpkey_iff_ravel": + owner => root, + group => root, + mode => 444, + source => [ "puppet:///modules/ntp/ntpkey_iff_ravel.pub" ], + require => Package["ntp"], + notify => Exec["ntp restart"], + ; + "/etc/ntp.keys.d/ntpkey_iff_busoni": + owner => root, + group => root, + mode => 444, + source => [ "puppet:///modules/ntp/ntpkey_iff_busoni.pub" ], + require => Package["ntp"], + notify => Exec["ntp restart"], + ; + } + } + } + + + exec { "ntp restart": + path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin", + refreshonly => true, + } + @ferm::rule { "dsa-ntp": + domain => "(ip ip6)", + description => "Allow ntp access", + rule => "&SERVICE(udp, 123)" + } } +# vim:set et: +# vim:set sts=4 ts=4: +# vim:set shiftwidth=4: