fix(migration): create the WAN vif before PPPoE references it

`set interfaces pppoe pppoe0 source-interface bond0.51` refers to an interface
that must already exist, and neither firewall has vif 51 -- only 2, 3, 9, 10
and 200 are configured. The commit would have failed, and since the whole delta
commits as one unit, that failure would have taken the entire switch with it at
the worst possible moment.

No address on the vif: PPPoE rides the VLAN and needs no L3 of its own.

Found by checking the running config against the generated delta rather than by
running it. The prod delta has still never been applied to any VyOS, which is
the remaining gap.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMVzWZgiKW2wquf5z8S1yH
This commit is contained in:
Michal
2026-08-15 23:51:13 +01:00
parent d56bbf6db0
commit 7f5d3517a3

View File

@@ -85,6 +85,14 @@ def build_delta(inv: dict, priority: int, wan_user: str) -> list[str]:
"# Vodafone line, PPPoE over the trunked WAN VLAN. This is the one", "# Vodafone line, PPPoE over the trunked WAN VLAN. This is the one",
"# part that cannot be tested before cutover: the line permits a", "# part that cannot be tested before cutover: the line permits a",
"# single session and the USG holds it until it is unplugged.", "# single session and the USG holds it until it is unplugged.",
"#",
"# The WAN vif must be created first. Neither firewall has vif 51 today",
"# (only 2, 3, 9, 10 and 200 exist), and pppoe source-interface refers to",
"# an interface that has to already be configured -- without this the",
"# commit fails and takes the whole switch with it. No address on it:",
"# PPPoE rides the VLAN, it does not need L3 of its own.",
f"set interfaces bonding bond0 vif {WAN_VIF.split('.')[1]} description 'WAN (Vodafone, PPPoE)'",
"",
f"set interfaces pppoe {WAN_IF} source-interface {WAN_VIF}", f"set interfaces pppoe {WAN_IF} source-interface {WAN_VIF}",
f"set interfaces pppoe {WAN_IF} authentication username '{wan_user}'", f"set interfaces pppoe {WAN_IF} authentication username '{wan_user}'",
f"set interfaces pppoe {WAN_IF} authentication password '{PLACEHOLDER}'", f"set interfaces pppoe {WAN_IF} authentication password '{PLACEHOLDER}'",