]> git.openstreetmap.org Git - chef.git/blob - cookbooks/geodns/recipes/default.rb
Increase nf_conntrack_max for tile caches
[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 if node[:lsb][:release].to_f >= 18.04
42   service "systemd-resolved" do
43     action [:disable, :stop]
44   end
45 end
46
47 service "gdnsd" do
48   action [:enable, :start]
49   supports :status => true, :restart => true, :reload => true
50 end
51
52 firewall_rule "accept-dns-udp" do
53   action :accept
54   source "net"
55   dest "fw"
56   proto "udp"
57   dest_ports "domain"
58 end
59
60 firewall_rule "accept-dns-tcp" do
61   action :accept
62   source "net"
63   dest "fw"
64   proto "tcp:syn"
65   dest_ports "domain"
66 end