interate only webpacs in templates

This commit is contained in:
Peter Hormanns 2017-06-29 10:55:23 +02:00
parent c1aca570f7
commit 5a7dfa87b6
6 changed files with 19 additions and 9 deletions

View File

@ -6,6 +6,8 @@ import static javax.persistence.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE; import static javax.persistence.GenerationType.SEQUENCE;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set; import java.util.Set;
import javax.persistence.Column; import javax.persistence.Column;
@ -117,6 +119,16 @@ public class Hive extends AbstractEntity implements Serializable {
public Set<Pac> getPacs() { public Set<Pac> getPacs() {
return pacs; return pacs;
} }
public List<Pac> getWebpacs() {
final ArrayList<Pac> webpacs = new ArrayList<Pac>();
for (final Pac pac : pacs) {
if (!pac.isManagedServer()) {
webpacs.add(pac);
}
}
return webpacs;
}
public void setPacs(Set<Pac> pacs) { public void setPacs(Set<Pac> pacs) {
this.pacs = pacs; this.pacs = pacs;

View File

@ -14,6 +14,6 @@ ff02::3 ip6-allhosts
${hive.inetAddr.inetAddr} ${hive.name}.hostsharing.net ${hive.name} localhive ${hive.inetAddr.inetAddr} ${hive.name}.hostsharing.net ${hive.name} localhive
#foreach( $pac in ${hive.pacs} ) #foreach( $pac in ${hive.webpacs} )
${pac.curINetAddr.inetAddr} ${pac.name}.hostsharing.net ${pac.name} ${pac.curINetAddr.inetAddr} ${pac.name}.hostsharing.net ${pac.name}
#end #end

View File

@ -3,10 +3,10 @@
# Do not edit manually. Changes will be overwritten. # Do not edit manually. Changes will be overwritten.
# #
#foreach( $pac in ${hive.pacs} ) #foreach( $pac in ${hive.webpacs} )
<VirtualHost ${pac.curINetAddr.inetAddr}:80> <VirtualHost ${pac.curINetAddr.inetAddr}:80>
ServerName _ ServerName _
ServerAdmin webmaster@${pac.getName} ServerAdmin webmaster@${pac.getName}.hostsharing.net
<Directory /> <Directory />
Redirect 404 / Redirect 404 /
@ -16,7 +16,7 @@
<VirtualHost ${pac.curINetAddr.inetAddr}:443> <VirtualHost ${pac.curINetAddr.inetAddr}:443>
ServerName _ ServerName _
ServerAdmin webmaster@${pac.getName} ServerAdmin webmaster@${pac.getName}.hostsharing.net
SSLEngine On SSLEngine On
SSLCertificateFile /etc/apache2/pems-enabled/${pac.getName}.crt SSLCertificateFile /etc/apache2/pems-enabled/${pac.getName}.crt

View File

@ -3,8 +3,6 @@
# Do not edit manually. Changes will be overwritten. # Do not edit manually. Changes will be overwritten.
# #
# #
#foreach( $pac in ${hive.pacs} ) #foreach( $pac in ${hive.webpacs} )
#if( !${pac.managedServer} )
eth0:${pac.name}:${pac.curINetAddr.inetAddr}/32 eth0:${pac.name}:${pac.curINetAddr.inetAddr}/32
#end
#end #end

View File

@ -3,7 +3,7 @@
# Do not edit manually. Changes will be overwritten. # Do not edit manually. Changes will be overwritten.
# #
#foreach( $pac in ${hive.pacs} ) #foreach( $pac in ${hive.webpacs} )
<VirtualHost ${pac.curINetAddr.inetAddr}> <VirtualHost ${pac.curINetAddr.inetAddr}>
DefaultRoot ~ ${pac.name} DefaultRoot ~ ${pac.name}
ServerName "${pac.name}.hostsharing.net" ServerName "${pac.name}.hostsharing.net"

View File

@ -3,6 +3,6 @@
# Do not edit manually. Changes will be overwritten. # Do not edit manually. Changes will be overwritten.
# #
#foreach( $pac in ${hive.pacs} ) #foreach( $pac in ${hive.webpacs} )
${pac.name} ALL = (%${pac.name}) NOPASSWD: ALL ${pac.name} ALL = (%${pac.name}) NOPASSWD: ALL
#end #end