From: nicoo Date: Fri, 7 Feb 2020 11:52:22 +0000 (+0100) Subject: vm/network: Support configuring secondary network interfaces X-Git-Url: https://git.realraum.at/?p=noc.git;a=commitdiff_plain;h=83abc1f5cdb06e71e8674480d59a02365a967750 vm/network: Support configuring secondary network interfaces --- diff --git a/ansible/roles/vm/network/templates/interfaces.j2 b/ansible/roles/vm/network/templates/interfaces.j2 index 829a3e7..e632a9d 100644 --- a/ansible/roles/vm/network/templates/interfaces.j2 +++ b/ansible/roles/vm/network/templates/interfaces.j2 @@ -15,3 +15,16 @@ iface {{ network.primary.interface }} inet static gateway {{ network.primary.gateway }} pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf + +{% if 'secondary' in network %} +# Secondary network interfaces +{% for iface, v in network['secondary'].items() %} +auto {{ iface }} +iface {{ iface }} inet static + address {{ v.ip }} + netmask {{ v.mask }} + pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra + pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf + +{% endfor %} +{% endif %}