summaryrefslogtreecommitdiff
path: root/roles/vm/host
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-07-08 23:54:02 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-07-11 02:29:03 +0200
commitf21533408caf5ee34b6e5d4292b300fb29eb5065 (patch)
treed0fca6e63df5b8bfc0bc982a652999379490f483 /roles/vm/host
parenttest new vm/host/network on other machines... (diff)
improved vm/host/network config
Diffstat (limited to 'roles/vm/host')
-rw-r--r--roles/vm/host/network/templates/interfaces.j217
1 files changed, 12 insertions, 5 deletions
diff --git a/roles/vm/host/network/templates/interfaces.j2 b/roles/vm/host/network/templates/interfaces.j2
index eebfb8cc..fe57a024 100644
--- a/roles/vm/host/network/templates/interfaces.j2
+++ b/roles/vm/host/network/templates/interfaces.j2
@@ -6,14 +6,19 @@ auto lo
iface lo inet loopback
+## pyhiscal interfaces
+
+{% for interface in network.bonds | default([]) | map(attribute='slaves') | flatten | union(network.vlans | default({}) | list) | difference(network.bonds | default([]) | map(attribute='name') | list) | sort | unique %}
+auto {{ interface }}
+iface {{ interface }} inet manual
+ pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
+ pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
+
+{% endfor %}
+
{% for bond in network.bonds | default([]) %}
## Bond: {{ bond.name }}
-{% for slave in bond.slaves | sort %}
-auto {{ slave }}
-iface {{ slave }} inet manual
-
-{% endfor %}
{% set tmp = network.interfaces | selectattr('name', 'eq', bond.name) | list %}
auto {{ bond.name }}
iface {{ bond.name }} inet {{ ((tmp | length) == 0) | ternary('manual', 'static') }}
@@ -61,6 +66,8 @@ iface {{ interface.name }} inet6 static
{% for vlan in network.vlans[parent] %}
auto {{ parent }}.{{ vlan }}
iface {{ parent }}.{{ vlan }} inet manual
+ up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
+ up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
{# TODO: add interface config like above if (network.interfaces | selectattr('name', 'eq', 'parent+'.'+vlan') | list) > 0 ... #}
{% endfor %}