diff options
Diffstat (limited to 'roles/vm/host')
-rw-r--r-- | roles/vm/host/network/templates/interfaces/simple.j2 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/vm/host/network/templates/interfaces/simple.j2 b/roles/vm/host/network/templates/interfaces/simple.j2 index 26e8aec2..67665f57 100644 --- a/roles/vm/host/network/templates/interfaces/simple.j2 +++ b/roles/vm/host/network/templates/interfaces/simple.j2 @@ -3,9 +3,15 @@ {% if 'gateway' in interface %} gateway {{ interface.gateway }} {% endif %} +{% for address in interface.additional_addresses | default([]) %} + up /bin/ip addr add dev $IFACE {{ address }}/32 +{% endfor %} {% for route in interface.static_routes | default([]) %} up /bin/ip route add {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }} {% endfor %} {% for route in interface.static_routes | default([]) | reverse %} down /bin/ip route del {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }} {% endfor %} +{% for address in interface.additional_addresses | default([]) | reverse %} + down /bin/ip addr del dev $IFACE {{ address }}/32 +{% endfor %} |