From 2b39625159c50c3b2a2d95303f6470320288e39a Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Mon, 16 Feb 2026 17:22:55 +0100 Subject: [PATCH] feat: make interfaces file more readable --- tasks/routing.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/routing.yaml b/tasks/routing.yaml index 4995e08..be2a0fe 100644 --- a/tasks/routing.yaml +++ b/tasks/routing.yaml @@ -42,13 +42,14 @@ marker: " # {mark} ANSIBLE MANAGED STATIC ROUTES" block: | {% for route in static_routes %} - # {{ route.name }} + # {{ route.name }} {% if route.metric is defined %} down ip route del {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }} metric {{ route.metric }} up ip route add {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }} metric {{ route.metric }} {% else %} down ip route del {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }} up ip route add {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }} + {% endif %} {% endfor %} insertafter: "^iface {{ lan_interface }} inet.*\\n(\\s+.*\\n)*\\s+netmask"