summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roles/vm/host/tasks/network.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/vm/host/tasks/network.yml b/roles/vm/host/tasks/network.yml
index 3f2cdf5c..bc207805 100644
--- a/roles/vm/host/tasks/network.yml
+++ b/roles/vm/host/tasks/network.yml
@@ -41,8 +41,8 @@
up /sbin/iptables -t nat -A POSTROUTING -o {{ ansible_default_ipv4.interface }} -s {{ item.value.prefix | ipaddr('network/prefix') }} -j SNAT --to {{ ansible_default_ipv4.address }}
{% endif %}
{% if 'overlay' in item.value %}
- {% for dest in item.value.overlay.offsets %}
- up /bin/ip route add {{ (item.value.overlay.prefix | ipaddr(item.value.overlay.offsets[dest])).split('/')[0] }}/32 via {{ (item.value.prefix | ipaddr(item.value.offsets[dest])).split('/')[0] }} # {{ dest }}
+ {% for dest, offset in (item.value.overlay.offsets | dictsort(by='value')) %}
+ up /bin/ip route add {{ (item.value.overlay.prefix | ipaddr(offset)).split('/')[0] }}/32 via {{ (item.value.prefix | ipaddr(item.value.offsets[dest])).split('/')[0] }} # {{ dest }}
{% endfor %}
up /bin/ip route add unreachable {{ item.value.overlay.prefix }}
down /sbin/ip route del {{ item.value.overlay.prefix }}