Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 84544C739 for ; Fri, 9 Jan 2015 13:12:11 +0000 (UTC) Received: (qmail 30127 invoked by uid 500); 9 Jan 2015 13:12:12 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 30101 invoked by uid 500); 9 Jan 2015 13:12:12 -0000 Mailing-List: contact commits-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list commits@brooklyn.incubator.apache.org Received: (qmail 30092 invoked by uid 99); 9 Jan 2015 13:12:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 13:12:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 09 Jan 2015 13:11:48 +0000 Received: (qmail 29768 invoked by uid 99); 9 Jan 2015 13:11:46 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 13:11:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 07DE492BC58; Fri, 9 Jan 2015 13:11:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sjcorbett@apache.org To: commits@brooklyn.incubator.apache.org Date: Fri, 09 Jan 2015 13:11:46 -0000 Message-Id: <4ccf04f2850546f4866bf33689d50ff0@git.apache.org> In-Reply-To: <3c5fe07b4d93434fb04d7637b8cbf7ca@git.apache.org> References: <3c5fe07b4d93434fb04d7637b8cbf7ca@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/9] incubator-brooklyn git commit: BindDnsServer can optionally update root zones file X-Virus-Checked: Checked by ClamAV on apache.org 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 Authored: Fri Nov 21 16:24:04 2014 +0000 Committer: Sam Corbett 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 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