From c1961307c95011aba55568d38dbae9ef081bc428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sat, 16 Apr 2022 19:32:19 +0200 Subject: [PATCH] check if additionalinterfaces is empty --- roles/netplan/templates/netplan.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/netplan/templates/netplan.yaml b/roles/netplan/templates/netplan.yaml index 171f6ff..93477fc 100644 --- a/roles/netplan/templates/netplan.yaml +++ b/roles/netplan/templates/netplan.yaml @@ -11,6 +11,7 @@ network: {% if netplan.default_gateway is defined and netplan.default_gateway|length > 0 %} gateway4: {{netplan.default_gateway}} {% endif %} + {% if netplan.additionalinterfaces is defined and netplan.additionalinterfaces|length > 0 %} {% for interface in netplan.additionalinterfaces %} {{ interface.name }}: dhcp4: {{ interface.dhcp4 }} @@ -36,3 +37,4 @@ network: search: [] {% endif %} {% endfor %} + {% endif %}