make default gw configurable

This commit is contained in:
Peter Hormanns 2011-12-19 11:15:35 +00:00
parent 8abad315d4
commit 5646148b7e
2 changed files with 9 additions and 2 deletions

View File

@ -252,7 +252,9 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
Processor domSetupProcessor = new CompoundProcessor(
createDomainDirectoriesProcessor(dom, templateVars),
new CreateFileProcessor(selectVHostTemplate(dom), templateVars, "/etc/apache2/sites-generated/" + domName, "root", "root", "644"),
new ShellProcessor("ln -sf /etc/apache2/sites-generated/" + domName + " /etc/apache2/sites-enabled/010-" + domName + " && invoke-rc.d apache2 reload >/dev/null 2>&1")
new ShellProcessor(
"ln -sf /etc/apache2/sites-generated/" + domName + " /etc/apache2/sites-enabled/010-" + domName +
" && invoke-rc.d apache2 reload >/dev/null 2>&1")
);
return domSetupProcessor;
}

View File

@ -17,6 +17,7 @@ import de.hsadmin.core.qserv.ProcessorException;
import de.hsadmin.core.qserv.ShellProcessor;
import de.hsadmin.core.qserv.TemplateProcessor;
import de.hsadmin.core.qserv.WaitingTasksProcessor;
import de.hsadmin.core.util.Config;
import de.hsadmin.core.util.PasswordTool;
import de.hsadmin.mods.user.UnixUser;
@ -184,7 +185,11 @@ public class PacProcessorFactory implements EntityProcessorFactory {
hiveValues.put("HIVE", hive.getName());
String hiveIP = hive.getInetAddr().getInetAddr();
hiveValues.put("HIVE_IP", hiveIP);
hiveValues.put("HIVE_GATEWAY", hiveIP.substring(0, hiveIP.lastIndexOf('.')) + ".1");
String defaultGateway =
Config.getInstance().getProperty("hsadmin.default_gateway", hiveIP.substring(0, hiveIP.lastIndexOf('.')) + ".1");
defaultGateway =
Config.getInstance().getProperty("hsadmin." + hive.getName() + ".default_gateway", defaultGateway);
hiveValues.put("HIVE_GATEWAY", defaultGateway);
return hiveValues;
}