]> git.openstreetmap.org Git - chef.git/blob - cookbooks/geodns/recipes/default.rb
Switch to using gdnsd for geodns
[chef.git] / cookbooks / geodns / recipes / default.rb
1 #
2 # Cookbook Name:: geodns
3 # Recipe:: default
4 #
5 # Copyright 2011, OpenStreetMap Foundation
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 service "pdns" do
21   action [ :stop, :disable ]
22   supports :status => true, :restart => true, :reload => true
23 end
24
25 file "/etc/powerdns/countries.conf" do
26   action :delete
27 end
28
29 file "/etc/powerdns/pdns.d/pdns.simplebind" do
30   action :delete
31   notifies :reload, "service[pdns]"
32 end
33
34 file "/etc/powerdns/pdns.d/geo.conf" do
35   action :delete
36 end
37
38 file "/etc/powerdns/zones.d/tile.conf" do
39   action :delete
40 end
41
42 directory "/etc/powerdns/zones.d" do
43   action :delete
44 end
45
46 file "/etc/cron.weekly/geodns-update" do
47   action :delete
48 end
49
50 package "pdns-backend-geo" do
51   action :purge
52 end
53
54 package "pdns-server" do
55   action :purge
56 end
57
58 package "geoip-database-contrib"
59
60 package "gdnsd"
61
62 service "gdnsd" do
63   action [ :enable, :start ]
64   supports :status => true, :restart => true, :reload => true
65 end
66
67 template "/etc/gdnsd/config" do
68   source "config.erb"
69   owner "root"
70   group "root"
71   mode 0644
72   notifies :restart, "service[gdnsd]"
73 end
74
75 template "/etc/gdnsd/zones/geo.openstreetmap.org" do
76   source "geo.erb"
77   owner "root"
78   group "root"
79   mode 0644
80   notifies :restart, "service[gdnsd]"
81 end
82
83 firewall_rule "accept-dns-udp" do
84   action :accept
85   source "net"
86   dest "fw"
87   proto "udp"
88   dest_ports "domain"
89 end
90
91 firewall_rule "accept-dns-tcp" do
92   action :accept
93   source "net"
94   dest "fw"
95   proto "tcp:syn"
96   dest_ports "domain"
97 end