Route DNS for multi-node caches through the weighted plugin
authorTom Hughes <tom@compton.nu>
Fri, 6 Dec 2019 09:24:13 +0000 (09:24 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 6 Dec 2019 09:24:13 +0000 (09:24 +0000)
bin/mkgeo

index 2e0ac009c192c1efc44dbab4da62ebee729ab6ab..0df8c32bd8a34a10875c7c9c42a94e88ede42ae1 100755 (executable)
--- a/bin/mkgeo
+++ b/bin/mkgeo
@@ -331,8 +331,6 @@ if (defined($gdnsname))
     {
         my $name = $cluster->{name};
 
-        $gdnsresourcefile->print("    ${name} => ${name}.${zone}.\n");
-
         if (@{$cluster->{servers}} > 1)
         {
             $gdnsweightedfile->print("${name} => {\n");
@@ -349,6 +347,12 @@ if (defined($gdnsname))
             }
 
             $gdnsweightedfile->print("}\n");
+
+            $gdnsresourcefile->print("    ${name} => %weighted!${name}\n");
+        }
+        else
+        {
+            $gdnsresourcefile->print("    ${name} => ${name}.${zone}.\n");
         }
     }