setup a network interface only if the pac has its own IP address
This commit is contained in:
parent
828420d4a7
commit
c308720e84
@ -130,6 +130,16 @@ public class Hive extends AbstractEntity implements Serializable {
|
||||
return webpacs;
|
||||
}
|
||||
|
||||
public List<Pac> getPacsWithIPAddress() {
|
||||
final ArrayList<Pac> pacsWithIPAddress = new ArrayList<Pac>();
|
||||
for (final Pac pac : pacs) {
|
||||
if (!pac.isManagedServer() && !pac.usesPacIPAddress()) {
|
||||
pacsWithIPAddress.add(pac);
|
||||
}
|
||||
}
|
||||
return pacsWithIPAddress;
|
||||
}
|
||||
|
||||
public void setPacs(Set<Pac> pacs) {
|
||||
this.pacs = pacs;
|
||||
}
|
||||
|
@ -294,4 +294,10 @@ public class Pac extends AbstractEntity implements Serializable {
|
||||
String basepacName = getBasepac().getName();
|
||||
return BasePacType.PAC_SRV.equals(basepacName);
|
||||
}
|
||||
|
||||
public boolean usesPacIPAddress() {
|
||||
String hiveIP = hive.getInetAddr().getInet4Addr();
|
||||
String pacIP = getCurINetAddr().getInet4Addr();
|
||||
return pacIP.equals(hiveIP);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ ff02::3 ip6-allhosts
|
||||
${hive.inetAddr.inet4Addr} ${hive.name}.hostsharing.net ${hive.name} localhive
|
||||
${hive.inetAddr.inet6Addr} ${hive.name}.hostsharing.net ${hive.name} localhive
|
||||
|
||||
#foreach( $pac in ${hive.webpacs} )
|
||||
#foreach( $pac in ${hive.pacsWithIPAddress} )
|
||||
${pac.curINetAddr.inet4Addr} ${pac.name}.hostsharing.net ${pac.name}
|
||||
${pac.curINetAddr.inet6Addr} ${pac.name}.hostsharing.net ${pac.name}
|
||||
#end
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Do not edit manually. Changes will be overwritten.
|
||||
#
|
||||
|
||||
#foreach( $pac in ${hive.webpacs} )
|
||||
#foreach( $pac in ${hive.pacsWithIPAddress} )
|
||||
<VirtualHost ${pac.curINetAddr.inet4Addr}:80 [${pac.curINetAddr.inet6Addr}]:80>
|
||||
ServerName _
|
||||
ServerAdmin webmaster@${pac.name}.hostsharing.net
|
||||
|
@ -3,6 +3,6 @@
|
||||
# Do not edit manually. Changes will be overwritten.
|
||||
#
|
||||
#
|
||||
#foreach( $pac in ${hive.webpacs} )
|
||||
#foreach( $pac in ${hive.pacsWithIPAddress} )
|
||||
eth0|${pac.name}|${pac.curINetAddr.inet4Addr}/32
|
||||
#end
|
@ -3,6 +3,6 @@
|
||||
# Do not edit manually. Changes will be overwritten.
|
||||
#
|
||||
#
|
||||
#foreach( $pac in ${hive.webpacs} )
|
||||
#foreach( $pac in ${hive.pacsWithIPAddress} )
|
||||
eth0|${pac.name}|${pac.curINetAddr.inet6Addr}/128
|
||||
#end
|
||||
|
Loading…
Reference in New Issue
Block a user