Move crontab geodns boot into dsa-puppet-stuff
[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         #site::aptrepo { 'geoip':
11         #       url        => 'http://db.debian.org/debian-admin',
12         #       suite      => 'lenny-bind-geoip',
13         #       components => 'main',
14         #}
15         site::aptrepo { 'geoip': ensure => absent }
16
17         file { '/etc/bind/':
18                 ensure  => directory,
19                 group  => bind,
20                 mode   => '2755',
21                 require => Package['bind9'],
22                 notify  => Service['bind9'],
23         }
24         file { '/etc/bind/geodns':
25                 ensure => directory,
26                 mode   => '0755',
27         }
28         file { '/etc/bind/named.conf.options':
29                 content => template('named/named.conf.options.erb'),
30                 notify  => Service['bind9'],
31         }
32         file { '/etc/bind/named.conf.local':
33                 source => 'puppet:///modules/named/common/named.conf.local',
34                 notify  => Service['bind9'],
35         }
36         if (versioncmp($::lsbmajdistrelease, '9') >= 0) {
37                 file { '/etc/bind/named.conf.acl':
38                         source => 'puppet:///modules/named/common/named.conf.acl',
39                         notify  => Service['bind9'],
40                 }
41         } else {
42                 file { '/etc/bind/named.conf.acl':
43                         source => 'puppet:///modules/named/common/named.conf.acl.bind99',
44                         notify  => Service['bind9'],
45                 }
46         }
47         file { '/etc/bind/geodns/zonefiles':
48                 ensure => directory,
49                 owner  => geodnssync,
50                 group  => geodnssync,
51                 mode   => '2755',
52         }
53         file { '/etc/bind/geodns/named.conf.geo':
54                 source => 'puppet:///modules/named/common/named.conf.geo',
55                 notify  => Service['bind9'],
56         }
57         file { '/etc/bind/geodns/trigger':
58                 mode   => '0555',
59                 source => 'puppet:///modules/named/common/trigger',
60         }
61         file { '/etc/ssh/userkeys/geodnssync':
62                 source => 'puppet:///modules/named/common/authorized_keys',
63                 group  => geodnssync,
64                 mode   => '0440',
65         }
66         file { '/etc/cron.d/dsa-boot-geodnssync':
67                 ensure => absent;
68         }
69         concat::fragment { 'dsa-puppet-stuff--geodns-boot':
70                 target => '/etc/cron.d/dsa-puppet-stuff',
71                 content  => @(EOF)
72                         @reboot geodnssync sleep 1m && /etc/bind/geodns/trigger > /dev/null
73                         | EOF
74         }
75 }