From 5866337e217aa515c16ecf87fd3320ca750d8c0f Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@jalin.de>
Date: Mon, 29 Jul 2019 18:49:08 +0200
Subject: [PATCH] send zones list to dns servers

---
 hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
index 564ce77..251a450 100644
--- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
+++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -20,6 +20,7 @@
 import de.hsadmin.core.qserv.ShellProcessor;
 import de.hsadmin.core.qserv.VelocityProcessor;
 import de.hsadmin.core.qserv.WaitingTasksProcessor;
+import de.hsadmin.core.util.Config;
 import de.hsadmin.core.util.PasswordTool;
 import de.hsadmin.hostsharing.BasePacType;
 import de.hsadmin.hostsharing.QuotaLimit;
@@ -39,7 +40,7 @@
 			Hive hive = pac.getHive();
 			UnixUser unixUser = getPacAdminUser(pac);
 			String password = PasswordTool.generatePassword();
-			return new CompoundProcessor(
+			WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(new CompoundProcessor(
 				createAddUserProc(pacName, unixUser, password),
 				createSetQuotaProc(pac),
 				createEtcHostsProc(hive),
@@ -51,8 +52,12 @@
 				createMakePacDirectoryStructure(unixUser),
 				createIfUp(pac),
 				createHttpdVirtualProc(hive),
-				createDNSServerConfigProcessor(em),
-				createAccountingRulesProc());
+				createAccountingRulesProc()));
+			final Config config = Config.getInstance();
+			for (String queueName : config.getProperty("queues.dns").split(",")) {
+				mainProcessor.appendProcessor(queueName, createDNSServerConfigProcessor(em), queueName + ".hostsharing.net");
+			}
+			return mainProcessor;
 		} else {
 			return new NullProcessor();
 		}
@@ -65,13 +70,18 @@
 		String basepacName = pac.getBasepac().getName();
 		if (basepacName.equals(BasePacType.PAC_WEB)) {
 			Hive hive = pac.getHive();
-			return new CompoundProcessor(
+			final WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor( new CompoundProcessor(
 				createEtcHostsProc(hive),
 				createNetworkInterfacesProc(hive),
 				createProftpdConfProc(hive),
 		        createHttpdVirtualProc(hive),
 				createSetQuotaProc(pac)
-				);
+				));
+			final Config config = Config.getInstance();
+			for (String queueName : config.getProperty("queues.dns").split(",")) {
+				mainProcessor.appendProcessor(queueName, createDNSServerConfigProcessor(em), queueName + ".hostsharing.net");
+			}
+			return mainProcessor;
 		} else {
 			return new NullProcessor();
 		}
@@ -93,7 +103,6 @@
 				createSudouersProc(hive),
 				createProftpdConfProc(hive),
 		        createHttpdVirtualProc(hive),
-				createDNSServerConfigProcessor(em),
 		        createHiveDNSRemoveProcessor(domainName),
 		        createAccountingRulesProc()), "remove packet");
 			return waiting;

--
Gitblit v1.9.0-SNAPSHOT