]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/geodns/recipes/default.rb
Ensure there is always at least one geodns server
[chef.git] / cookbooks / geodns / recipes / default.rb
index 36813bcb4157b5189b528bfd44ff8026a6ec9ccb..c006ff9dcff4827a40a3322152ce19adf9589c24 100644 (file)
 
 include_recipe "geoipupdate"
 
+servers = search(:node, "roles:geodns").collect(&:name).sort
+
+servers << "dummy.example.com" if servers.empty?
+
 package %w[
   gdnsd
 ]
@@ -55,6 +59,7 @@ template "/etc/gdnsd/zones/geo.openstreetmap.org" do
   owner "root"
   group "root"
   mode "644"
+  variables :servers => servers
   notifies :restart, "service[gdnsd]"
 end