feat(schema,objects): add local_identifier to BGP types for unique HFID — refs #52

Infrahub does not support relation traversal in HFID computation.
Add a local_identifier attribute to PeerGroup, Session, and
AddressFamily that combines device name with the type-specific key.

Schema changes (bgp.yml):
- InfraBGPPeerGroup: HFID=local_identifier__value (e.g. spine1__evpn)
- InfraBGPSession: HFID=local_identifier__value (e.g. spine1__10.0.250.11)
- InfraBGPAddressFamily: HFID=local_identifier__value (e.g. spine1__ipv4_unicast)

Object file changes:
- 09-bgp.yml: added local_identifier to 26 PeerGroup entries
- 10-bgp-sessions.yml: added local_identifier to 72 Session + 20 AF entries,
  updated 56 peer_group + 26 active_peer_groups references
This commit is contained in:
Damien
2026-02-15 21:31:03 +01:00
parent 4b1ca7b2a6
commit cb06068347
3 changed files with 215 additions and 86 deletions

View File

@@ -151,6 +151,7 @@ spec:
# ============================================================
# Spine1 — evpn peer-group
- bgp_config: ["spine1"]
local_identifier: "spine1__evpn"
name: evpn
description: EVPN overlay to leaf loopbacks
peer_group_type: evpn
@@ -162,6 +163,7 @@ spec:
maximum_routes_warning_only: true
# Spine2 — evpn peer-group
- bgp_config: ["spine2"]
local_identifier: "spine2__evpn"
name: evpn
description: EVPN overlay to leaf loopbacks
peer_group_type: evpn
@@ -176,6 +178,7 @@ spec:
# ============================================================
# Leaf1
- bgp_config: ["leaf1"]
local_identifier: "leaf1__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -183,6 +186,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf1"]
local_identifier: "leaf1__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -191,6 +195,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf1"]
local_identifier: "leaf1__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn
@@ -202,6 +207,7 @@ spec:
maximum_routes_warning_only: true
# Leaf2
- bgp_config: ["leaf2"]
local_identifier: "leaf2__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -209,6 +215,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf2"]
local_identifier: "leaf2__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -217,6 +224,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf2"]
local_identifier: "leaf2__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn
@@ -228,6 +236,7 @@ spec:
maximum_routes_warning_only: true
# Leaf3
- bgp_config: ["leaf3"]
local_identifier: "leaf3__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -235,6 +244,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf3"]
local_identifier: "leaf3__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -243,6 +253,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf3"]
local_identifier: "leaf3__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn
@@ -254,6 +265,7 @@ spec:
maximum_routes_warning_only: true
# Leaf4
- bgp_config: ["leaf4"]
local_identifier: "leaf4__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -261,6 +273,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf4"]
local_identifier: "leaf4__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -269,6 +282,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf4"]
local_identifier: "leaf4__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn
@@ -280,6 +294,7 @@ spec:
maximum_routes_warning_only: true
# Leaf5
- bgp_config: ["leaf5"]
local_identifier: "leaf5__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -287,6 +302,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf5"]
local_identifier: "leaf5__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -295,6 +311,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf5"]
local_identifier: "leaf5__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn
@@ -306,6 +323,7 @@ spec:
maximum_routes_warning_only: true
# Leaf6
- bgp_config: ["leaf6"]
local_identifier: "leaf6__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -313,6 +331,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf6"]
local_identifier: "leaf6__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -321,6 +340,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf6"]
local_identifier: "leaf6__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn
@@ -332,6 +352,7 @@ spec:
maximum_routes_warning_only: true
# Leaf7
- bgp_config: ["leaf7"]
local_identifier: "leaf7__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -339,6 +360,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf7"]
local_identifier: "leaf7__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -347,6 +369,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf7"]
local_identifier: "leaf7__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn
@@ -358,6 +381,7 @@ spec:
maximum_routes_warning_only: true
# Leaf8
- bgp_config: ["leaf8"]
local_identifier: "leaf8__underlay"
name: underlay
description: Underlay eBGP to spines
peer_group_type: underlay
@@ -365,6 +389,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf8"]
local_identifier: "leaf8__underlay_ibgp"
name: underlay_ibgp
description: MLAG iBGP peering
peer_group_type: underlay_ibgp
@@ -373,6 +398,7 @@ spec:
maximum_routes: 12000
maximum_routes_warning_only: true
- bgp_config: ["leaf8"]
local_identifier: "leaf8__evpn"
name: evpn
description: EVPN overlay to spines
peer_group_type: evpn