move 3rd party nameserver info from the ferm template to hiera, retire geodns old...
[mirror/dsa-puppet.git] / modules / named / manifests / geodns.pp
1 class named::geodns inherits named {
2   munin::check { 'bind_views':
3     script => bind
4   }
5
6   package { 'geoip-database':
7     ensure => installed,
8   }
9
10   file { '/etc/bind/':
11     ensure  => directory,
12     group   => bind,
13     mode    => '2755',
14     require => Package['bind9'],
15     notify  => Service['bind9'],
16   }
17   file { '/etc/bind/geodns':
18     ensure => directory,
19     mode   => '0755',
20   }
21   file { '/etc/bind/named.conf.local':
22     source => 'puppet:///modules/named/common/named.conf.local',
23     notify => Service['bind9'],
24   }
25   if (versioncmp($::lsbmajdistrelease, '9') >= 0) {
26     file { '/etc/bind/named.conf.acl':
27       source => 'puppet:///modules/named/common/named.conf.acl',
28       notify => Service['bind9'],
29     }
30   } else {
31     file { '/etc/bind/named.conf.acl':
32       source => 'puppet:///modules/named/common/named.conf.acl.bind99',
33       notify => Service['bind9'],
34     }
35   }
36   file { '/etc/bind/geodns/zonefiles':
37     ensure => directory,
38     owner  => geodnssync,
39     group  => geodnssync,
40     mode   => '2755',
41   }
42   file { '/etc/bind/geodns/named.conf.geo':
43     source => 'puppet:///modules/named/common/named.conf.geo',
44     notify => Service['bind9'],
45   }
46   file { '/etc/bind/geodns/trigger':
47     mode   => '0555',
48     source => 'puppet:///modules/named/common/trigger',
49   }
50   file { '/etc/cron.d/dsa-boot-geodnssync': ensure => absent; }
51   concat::fragment { 'puppet-crontab--geodns-boot':
52     target  => '/etc/cron.d/puppet-crontab',
53     content => @(EOF)
54       @reboot geodnssync sleep 1m && /etc/bind/geodns/trigger > /dev/null
55       | EOF
56   }
57
58   ferm::rule::simple { '01-dsa-bind':
59     description => 'Allow nameserver access',
60     proto       => ['udp', 'tcp'],
61     port        => 'domain',
62   }
63 }