X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fnamed%2Fmanifests%2Fgeodns.pp;h=ef2fa14ccb31b353f586a0aa3674a8be30bc9b3b;hb=2835c1daf1a5f55ec56366fa5d534b6bfc7728cb;hp=b12593dac8b139cc42c0ae36197ef2a329ecf7fe;hpb=132ca45393a7d7fe277a5eb391e211d2c1775d24;p=mirror%2Fdsa-puppet.git diff --git a/modules/named/manifests/geodns.pp b/modules/named/manifests/geodns.pp index b12593dac..ef2fa14cc 100644 --- a/modules/named/manifests/geodns.pp +++ b/modules/named/manifests/geodns.pp @@ -3,8 +3,8 @@ class named::geodns inherits named { script => bind } - site::aptrepo { 'geoip': - template => 'debian-org/etc/apt/sources.list.d/geoip.list.erb', + package { 'geoip-database': + ensure => installed, } file { '/etc/bind/': @@ -18,14 +18,20 @@ class named::geodns inherits named { ensure => directory, mode => '0755', } - file { '/etc/bind/named.conf.options': - content => template('named/named.conf.options.erb'), - } file { '/etc/bind/named.conf.local': source => 'puppet:///modules/named/common/named.conf.local', + notify => Service['bind9'], } - file { '/etc/bind/named.conf.acl': - source => 'puppet:///modules/named/common/named.conf.acl', + if (versioncmp($::lsbmajdistrelease, '9') >= 0) { + file { '/etc/bind/named.conf.acl': + source => 'puppet:///modules/named/common/named.conf.acl', + notify => Service['bind9'], + } + } else { + file { '/etc/bind/named.conf.acl': + source => 'puppet:///modules/named/common/named.conf.acl.bind99', + notify => Service['bind9'], + } } file { '/etc/bind/geodns/zonefiles': ensure => directory, @@ -35,17 +41,23 @@ class named::geodns inherits named { } file { '/etc/bind/geodns/named.conf.geo': source => 'puppet:///modules/named/common/named.conf.geo', + notify => Service['bind9'], } file { '/etc/bind/geodns/trigger': mode => '0555', source => 'puppet:///modules/named/common/trigger', } - file { '/etc/ssh/userkeys/geodnssync': - source => 'puppet:///modules/named/common/authorized_keys', - group => geodnssync, - mode => '0440', + file { '/etc/cron.d/dsa-boot-geodnssync': ensure => absent; } + concat::fragment { 'puppet-crontab--geodns-boot': + target => '/etc/cron.d/puppet-crontab', + content => @(EOF) + @reboot geodnssync sleep 1m && /etc/bind/geodns/trigger > /dev/null + | EOF } - file { '/etc/cron.d/dsa-boot-geodnssync': - source => 'puppet:///modules/named/common/cron-geo' + + ferm::rule { '01-dsa-bind': + domain => '(ip ip6)', + description => 'Allow nameserver access', + rule => '&TCP_UDP_SERVICE(53)' } }