projects
/
noc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d65597b
)
vm/network: Support configuring secondary network interfaces
author
nicoo
<nicoo@realraum.at>
Fri, 7 Feb 2020 11:52:22 +0000
(12:52 +0100)
committer
nicoo
<nicoo@realraum.at>
Fri, 7 Feb 2020 12:24:43 +0000
(13:24 +0100)
ansible/roles/vm/network/templates/interfaces.j2
patch
|
blob
|
history
diff --git
a/ansible/roles/vm/network/templates/interfaces.j2
b/ansible/roles/vm/network/templates/interfaces.j2
index
829a3e7
..
e632a9d
100644
(file)
--- 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
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 %}