brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorb...@apache.org
Subject [2/9] incubator-brooklyn git commit: BindDnsServer can optionally update root zones file
Date Fri, 09 Jan 2015 13:11:46 GMT
BindDnsServer can optionally update root zones file


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/845a9c26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/845a9c26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/845a9c26

Branch: refs/heads/master
Commit: 845a9c26aa49eea4d93b587d81fbf1893c4c1519
Parents: d5244b7
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Fri Nov 21 16:24:04 2014 +0000
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Wed Jan 7 17:15:22 2015 +0000

----------------------------------------------------------------------
 .../main/java/brooklyn/entity/network/bind/BindDnsServer.java   | 5 +++++
 .../brooklyn/entity/network/bind/BindDnsServerSshDriver.java    | 4 ++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/845a9c26/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServer.java
----------------------------------------------------------------------
diff --git a/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServer.java
b/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServer.java
index 6f0cbae..bbb2712 100644
--- a/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServer.java
+++ b/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServer.java
@@ -87,6 +87,11 @@ public interface BindDnsServer extends SoftwareProcess {
             "bind.template.named-conf", "The BIND named configuration file (as FreeMarker
template)",
             "classpath://brooklyn/entity/network/bind/named.conf");
 
+    @SetFromFlag("updateRootZonesFile")
+    ConfigKey<Boolean> UPDATE_ROOT_ZONES_FILE = ConfigKeys.newBooleanConfigKey(
+            "bind.updateRootZones", "Instructs the entity to fetch the latest root zones
file from ftp.rs.internic.net.",
+            Boolean.FALSE);
+
 
     /* Reverse lookup attributes. */
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/845a9c26/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServerSshDriver.java
----------------------------------------------------------------------
diff --git a/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServerSshDriver.java
b/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServerSshDriver.java
index 9a4c849..dd00cfe 100644
--- a/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServerSshDriver.java
+++ b/software/network/src/main/java/brooklyn/entity/network/bind/BindDnsServerSshDriver.java
@@ -82,6 +82,10 @@ public class BindDnsServerSshDriver extends AbstractSoftwareProcessSshDriver
imp
                 // TODO Iptables is not a service on Ubuntu
                 BashCommands.sudo("service iptables save"),
                 BashCommands.sudo("service iptables restart"));
+        if (getEntity().getConfig(BindDnsServer.UPDATE_ROOT_ZONES_FILE)) {
+            commands.add("wget --user=ftp --password=ftp ftp://ftp.rs.internic.net/domain/db.cache
" +
+                    "-O " + getOsSupport().getRootZonesFile());
+        }
         newScript(CUSTOMIZING)
                 .body.append(commands)
                 // fails if iptables is not a service, e.g. on ubuntu


Mime
View raw message