]> git.openstreetmap.org Git - chef.git/blob - cookbooks/geodns/recipes/default.rb
Create gdnsd config before trying to start the service
[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 #     https://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 package %w[
21   geoip-database-contrib
22   gdnsd
23 ]
24
25 template "/etc/gdnsd/config" do
26   source "config.erb"
27   owner "root"
28   group "root"
29   mode 0o644
30   notifies :restart, "service[gdnsd]"
31 end
32
33 template "/etc/gdnsd/zones/geo.openstreetmap.org" do
34   source "geo.erb"
35   owner "root"
36   group "root"
37   mode 0o644
38   notifies :restart, "service[gdnsd]"
39 end
40
41 service "gdnsd" do
42   action [:enable, :start]
43   supports :status => true, :restart => true, :reload => true
44 end
45
46 firewall_rule "accept-dns-udp" do
47   action :accept
48   source "net"
49   dest "fw"
50   proto "udp"
51   dest_ports "domain"
52 end
53
54 firewall_rule "accept-dns-tcp" do
55   action :accept
56   source "net"
57   dest "fw"
58   proto "tcp:syn"
59   dest_ports "domain"
60 end