]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/geodns/recipes/default.rb
Switch geodns to use GeoIP2
[chef.git] / cookbooks / geodns / recipes / default.rb
index ad2288c12dd3fb369e0fef0d1723f996cffda45a..a2134457ffab3fe5ba7fe3838a982c1c31f4de7b 100644 (file)
 #
 
 package %w[
-  geoip-database-contrib
+  geoipupdate
   gdnsd
 ]
 
-service "gdnsd" do
-  action [:enable, :start]
-  supports :status => true, :restart => true, :reload => true
+execute "geoipdate" do
+  command "geoipupdate"
+  user "root"
+  group "root"
+  not_if { ::File.exist?("/var/lib/GeoIP/GeoLite2-Country.mmdb") }
 end
 
 template "/etc/gdnsd/config" do
@@ -43,6 +45,15 @@ template "/etc/gdnsd/zones/geo.openstreetmap.org" do
   notifies :restart, "service[gdnsd]"
 end
 
+service "systemd-resolved" do
+  action [:disable, :stop]
+end
+
+service "gdnsd" do
+  action [:enable, :start]
+  supports :status => true, :restart => true, :reload => true
+end
+
 firewall_rule "accept-dns-udp" do
   action :accept
   source "net"