diff options
author | Christian Pointner <equinox@spreadspace.org> | 2024-02-14 14:42:23 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2024-02-14 14:42:23 +0100 |
commit | e5789acf5d258d10cf80feb4baf06e58d3fae334 (patch) | |
tree | 7b4a43e327ba6e53a7d3116ab40b935aac69f1ba /roles/vm/host/network/templates | |
parent | ele-calypso: add volume for /srv/video (diff) |
vm/*/network: add support for additinal addresses
Diffstat (limited to 'roles/vm/host/network/templates')
-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 %} |