From 5ae7126ce29a8986774f84081df3bc90be3daa4f Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sat, 27 Aug 2022 04:10:11 +0200 Subject: [PATCH] ifupdown2: add support for stanzas with no gateway --- roles/ifupdown2/templates/interfaces.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/ifupdown2/templates/interfaces.j2 b/roles/ifupdown2/templates/interfaces.j2 index 236a0ee..81ce05f 100644 --- a/roles/ifupdown2/templates/interfaces.j2 +++ b/roles/ifupdown2/templates/interfaces.j2 @@ -6,7 +6,8 @@ iface {{ name }} {% for address in iface.addresses %} address {{ address | ipaddr }} {% endfor %} -{% for gateway in iface.gateways %} +{% for gateway in iface.gateways | default([]) %} gateway {{ gateway | ipaddr }} {% endfor %} + {% endfor %}