send zones list to dns servers

This commit is contained in:
Peter Hormanns 2019-07-29 18:49:08 +02:00
parent 7e29161cd7
commit 5866337e21

View File

@ -20,6 +20,7 @@ import de.hsadmin.core.qserv.ProcessorException;
import de.hsadmin.core.qserv.ShellProcessor; import de.hsadmin.core.qserv.ShellProcessor;
import de.hsadmin.core.qserv.VelocityProcessor; import de.hsadmin.core.qserv.VelocityProcessor;
import de.hsadmin.core.qserv.WaitingTasksProcessor; import de.hsadmin.core.qserv.WaitingTasksProcessor;
import de.hsadmin.core.util.Config;
import de.hsadmin.core.util.PasswordTool; import de.hsadmin.core.util.PasswordTool;
import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.hostsharing.BasePacType;
import de.hsadmin.hostsharing.QuotaLimit; import de.hsadmin.hostsharing.QuotaLimit;
@ -39,7 +40,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
Hive hive = pac.getHive(); Hive hive = pac.getHive();
UnixUser unixUser = getPacAdminUser(pac); UnixUser unixUser = getPacAdminUser(pac);
String password = PasswordTool.generatePassword(); String password = PasswordTool.generatePassword();
return new CompoundProcessor( WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(new CompoundProcessor(
createAddUserProc(pacName, unixUser, password), createAddUserProc(pacName, unixUser, password),
createSetQuotaProc(pac), createSetQuotaProc(pac),
createEtcHostsProc(hive), createEtcHostsProc(hive),
@ -51,8 +52,12 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createMakePacDirectoryStructure(unixUser), createMakePacDirectoryStructure(unixUser),
createIfUp(pac), createIfUp(pac),
createHttpdVirtualProc(hive), 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 { } else {
return new NullProcessor(); return new NullProcessor();
} }
@ -65,13 +70,18 @@ public class PacProcessorFactory implements EntityProcessorFactory {
String basepacName = pac.getBasepac().getName(); String basepacName = pac.getBasepac().getName();
if (basepacName.equals(BasePacType.PAC_WEB)) { if (basepacName.equals(BasePacType.PAC_WEB)) {
Hive hive = pac.getHive(); Hive hive = pac.getHive();
return new CompoundProcessor( final WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor( new CompoundProcessor(
createEtcHostsProc(hive), createEtcHostsProc(hive),
createNetworkInterfacesProc(hive), createNetworkInterfacesProc(hive),
createProftpdConfProc(hive), createProftpdConfProc(hive),
createHttpdVirtualProc(hive), createHttpdVirtualProc(hive),
createSetQuotaProc(pac) 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 { } else {
return new NullProcessor(); return new NullProcessor();
} }
@ -93,7 +103,6 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createSudouersProc(hive), createSudouersProc(hive),
createProftpdConfProc(hive), createProftpdConfProc(hive),
createHttpdVirtualProc(hive), createHttpdVirtualProc(hive),
createDNSServerConfigProcessor(em),
createHiveDNSRemoveProcessor(domainName), createHiveDNSRemoveProcessor(domainName),
createAccountingRulesProc()), "remove packet"); createAccountingRulesProc()), "remove packet");
return waiting; return waiting;