diff --git a/.infrahub.yml b/.infrahub.yml deleted file mode 100644 index e02b890..0000000 --- a/.infrahub.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -schemas: - - infrahub/schemas -menus: - - infrahub/menus -objects: - - infrahub/objects/01-foundation.yml - - infrahub/objects/02-fabric.yml - - infrahub/objects/03-devices.yml - - infrahub/objects/04-interfaces.yml - - infrahub/objects/05-ipam.yml - - infrahub/objects/06-vlans-vxlan.yml - - infrahub/objects/07-interface-vlans.yml - - infrahub/objects/08-ipam-vlans.yml - - infrahub/objects/09-bgp.yml - - infrahub/objects/10-vrfs.yml - - infrahub/objects/11-bgp-sessions.yml - - infrahub/objects/12-mlag.yml - - infrahub/objects/13-ipam-links.yml - - infrahub/objects/14-fabric-links.yml - -queries: - - name: vlan_intent - file_path: infrahub/transforms/queries/vlan_intent.gql - - name: interface_intent - file_path: infrahub/transforms/queries/interface_intent.gql - - name: vxlan_intent - file_path: infrahub/transforms/queries/vxlan_intent.gql - - name: vrf_intent - file_path: infrahub/transforms/queries/vrf_intent.gql - - name: mlag_intent - file_path: infrahub/transforms/queries/mlag_intent.gql - - name: bgp_intent - file_path: infrahub/transforms/queries/bgp_intent.gql - -jinja2_transforms: - - name: vlan_yang_transform - description: "Generate VLAN configuration payload from Infrahub intent" - query: vlan_intent - template_path: infrahub/transforms/templates/vlan_yang.j2 - - name: interface_yang_transform - description: "Generate interface configuration payload from Infrahub intent" - query: interface_intent - template_path: infrahub/transforms/templates/interface_yang.j2 - - name: vxlan_yang_transform - description: "Generate VXLAN/VTEP configuration payload from Infrahub intent" - query: vxlan_intent - template_path: infrahub/transforms/templates/vxlan_yang.j2 - - name: vrf_yang_transform - description: "Generate VRF/L3VNI configuration payload from Infrahub intent" - query: vrf_intent - template_path: infrahub/transforms/templates/vrf_yang.j2 - - name: mlag_yang_transform - description: "Generate MLAG configuration payload from Infrahub intent" - query: mlag_intent - template_path: infrahub/transforms/templates/mlag_yang.j2 - - name: bgp_yang_transform - description: "Generate BGP configuration payload from Infrahub intent" - query: bgp_intent - template_path: infrahub/transforms/templates/bgp_yang.j2 diff --git a/infrahub/menus/fabric-menu.yml b/infrahub/menus/fabric-menu.yml deleted file mode 100644 index 8c15e34..0000000 --- a/infrahub/menus/fabric-menu.yml +++ /dev/null @@ -1,247 +0,0 @@ -# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/menu/latest.json -# Custom menu for EVPN-VXLAN Fabric Orchestrator -# Organizes schema nodes into logical topology-aligned categories ---- -apiVersion: infrahub.app/v1 -kind: Menu -spec: - data: - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # Fabric Topology - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Topology - name: Mainmenu - label: Fabric Topology - icon: "mdi:lan" - children: - data: - - namespace: Topology - name: Fabric - label: Fabrics - kind: InfraFabric - icon: "mdi:vector-polygon" - - - namespace: Topology - name: Site - label: Sites - kind: LocationSite - icon: "mingcute:building-4-line" - - - namespace: Topology - name: Device - label: Devices - kind: InfraDevice - icon: "mdi:server-network" - - - namespace: Topology - name: Platform - label: Platforms - kind: InfraPlatform - icon: "mdi:chip" - - - namespace: Topology - name: UnderlayLink - label: Underlay Links - kind: InfraUnderlayLink - icon: "mdi:cable-data" - - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # Interfaces - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Interfaces - name: Mainmenu - label: Interfaces - icon: "mdi:ethernet" - children: - data: - - namespace: Interfaces - name: Ethernet - label: Ethernet - kind: InfraInterfaceEthernet - icon: "mdi:ethernet" - - - namespace: Interfaces - name: Loopback - label: Loopback - kind: InfraInterfaceLoopback - icon: "mdi:reload" - - - namespace: Interfaces - name: VlanSvi - label: VLAN SVI - kind: InfraInterfaceVlan - icon: "mdi:lan" - - - namespace: Interfaces - name: Lag - label: LAG / Port-Channel - kind: InfraInterfaceLag - icon: "mdi:link-variant" - - - namespace: Interfaces - name: Vxlan - label: VXLAN Tunnel - kind: InfraInterfaceVxlan - icon: "mdi:tunnel" - - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # IP Addressing - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Addressing - name: Mainmenu - label: IP Addressing - icon: "mdi:ip-network" - children: - data: - - namespace: Addressing - name: IPAddress - label: IP Addresses - kind: InfraIPAddress - icon: "mdi:ip-network" - - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # Layer 2 / VXLAN - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Layer2 - name: Mainmenu - label: Layer 2 / VXLAN - icon: "mdi:switch" - children: - data: - - namespace: Layer2 - name: Vlan - label: VLANs - kind: InfraVLAN - icon: "mdi:lan-connect" - - - namespace: Layer2 - name: Vni - label: VNIs - kind: InfraVNI - icon: "mdi:tunnel-outline" - - - namespace: Layer2 - name: Vtep - label: VTEPs - kind: InfraVTEP - icon: "mdi:server-network-outline" - - - namespace: Layer2 - name: VlanVniMapping - label: VLAN-VNI Mappings - kind: InfraVlanVniMapping - icon: "mdi:swap-horizontal" - - - namespace: Layer2 - name: EvpnInstance - label: EVPN Instances - kind: InfraEVPNInstance - icon: "mdi:cloud-sync" - - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # Routing / BGP - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Routing - name: Mainmenu - label: Routing / BGP - icon: "mdi:routes" - children: - data: - - namespace: Routing - name: AutonomousSystem - label: Autonomous Systems - kind: InfraAutonomousSystem - icon: "mdi:cloud-outline" - - - namespace: Routing - name: BGPRouterConfig - label: BGP Router Config - kind: InfraBGPRouterConfig - icon: "mdi:router-wireless" - - - namespace: Routing - name: BGPPeerGroup - label: BGP Peer Groups - kind: InfraBGPPeerGroup - icon: "mdi:account-group" - - - namespace: Routing - name: BGPSession - label: BGP Sessions - kind: InfraBGPSession - icon: "mdi:connection" - - - namespace: Routing - name: BGPAddressFamily - label: BGP Address Families - kind: InfraBGPAddressFamily - icon: "mdi:format-list-bulleted" - - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # VRF - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Vrf - name: Mainmenu - label: VRF - icon: "mdi:router" - children: - data: - - namespace: Vrf - name: Vrf - label: VRFs - kind: InfraVRF - icon: "mdi:router" - - - namespace: Vrf - name: RouteTarget - label: Route Targets - kind: InfraRouteTarget - icon: "mdi:target" - - - namespace: Vrf - name: VrfAssignment - label: VRF Assignments - kind: InfraVRFDeviceAssignment - icon: "mdi:router-network" - - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # MLAG - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Mlag - name: Mainmenu - label: MLAG - icon: "mdi:link-variant" - children: - data: - - namespace: Mlag - name: MlagDomain - label: MLAG Domains - kind: InfraMlagDomain - icon: "mdi:link-variant" - - - namespace: Mlag - name: MlagPeerConfig - label: MLAG Peer Config - kind: InfraMlagPeerConfig - icon: "mdi:server-network" - - - namespace: Mlag - name: MlagInterface - label: MLAG Interfaces - kind: InfraMlagInterface - icon: "mdi:ethernet-cable" - - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - # Host Connectivity - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - namespace: Connectivity - name: Mainmenu - label: Host Connectivity - icon: "mdi:desktop-tower" - children: - data: - - namespace: Connectivity - name: HostConnection - label: Host Connections - kind: InfraHostConnection - icon: "mdi:desktop-tower" diff --git a/infrahub/objects/01-foundation.yml b/infrahub/objects/01-foundation.yml deleted file mode 100644 index faaf1ad..0000000 --- a/infrahub/objects/01-foundation.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Foundation objects: Site, Platform, Autonomous Systems -# Must be loaded first — referenced by all subsequent files ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: LocationSite - data: - - name: dc1 - description: Primary data center ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraPlatform - data: - - name: arista_eos - description: Arista EOS - napalm_driver: eos - netmiko_device_type: arista_eos ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraAutonomousSystem - data: - - asn: 64999 - description: Router for VRF gold external peering - as_type: private - - asn: 65000 - description: Spine AS - as_type: private - - asn: 65001 - description: Leaf pair 1 (leaf1/leaf2) - as_type: private - - asn: 65002 - description: Leaf pair 2 (leaf3/leaf4) - as_type: private - - asn: 65003 - description: Leaf pair 3 (leaf5/leaf6) - as_type: private - - asn: 65004 - description: Leaf pair 4 (leaf7/leaf8) - as_type: private diff --git a/infrahub/objects/02-fabric.yml b/infrahub/objects/02-fabric.yml deleted file mode 100644 index c0861f4..0000000 --- a/infrahub/objects/02-fabric.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Fabric definition — depends on LocationSite and InfraAutonomousSystem from 01-foundation ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraFabric - data: - - name: evpn-lab - description: Arista EVPN-VXLAN reference fabric - underlay_protocol: ebgp - overlay_protocol: evpn - anycast_gateway_mac: "c001.cafe.babe" - spine_asn: ["65000"] - sites: - - ["dc1"] diff --git a/infrahub/objects/03-devices.yml b/infrahub/objects/03-devices.yml deleted file mode 100644 index 794921b..0000000 --- a/infrahub/objects/03-devices.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Devices: 2 spines + 8 leafs -# Depends on: 01-foundation (Platform, Site, AutonomousSystem) ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraDevice - data: - # Spines - - name: spine1 - description: Spine1 - BGP EVPN Spine - role: spine - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65000"] - - name: spine2 - description: Spine2 - BGP EVPN Spine - role: spine - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65000"] - # Leaf pair 1 (VTEP1) - - name: leaf1 - description: Leaf1 - VTEP1 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65001"] - - name: leaf2 - description: Leaf2 - VTEP1 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65001"] - # Leaf pair 2 (VTEP2) - - name: leaf3 - description: Leaf3 - VTEP2 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65002"] - - name: leaf4 - description: Leaf4 - VTEP2 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65002"] - # Leaf pair 3 (VTEP3) - - name: leaf5 - description: Leaf5 - VTEP3 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65003"] - - name: leaf6 - description: Leaf6 - VTEP3 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65003"] - # Leaf pair 4 (VTEP4) - - name: leaf7 - description: Leaf7 - VTEP4 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65004"] - - name: leaf8 - description: Leaf8 - VTEP4 - role: leaf - status: active - platform: ["arista_eos"] - site: ["dc1"] - asn: ["65004"] diff --git a/infrahub/objects/04-interfaces.yml b/infrahub/objects/04-interfaces.yml deleted file mode 100644 index b63fb9c..0000000 --- a/infrahub/objects/04-interfaces.yml +++ /dev/null @@ -1,491 +0,0 @@ -# Interfaces: Loopback, Ethernet, LAG (Port-Channel), VLAN SVIs -# Depends on: 02-devices ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraInterfaceLoopback - data: - # Spine loopbacks (Lo0 only) - - device: ["spine1"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["spine2"] - name: Loopback0 - description: Router-ID - enabled: true - # Leaf loopbacks (Lo0 + Lo1) - - device: ["leaf1"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf1"] - name: Loopback1 - description: VTEP - enabled: true - - device: ["leaf2"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf2"] - name: Loopback1 - description: VTEP - enabled: true - - device: ["leaf3"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf3"] - name: Loopback1 - description: VTEP - enabled: true - - device: ["leaf4"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf4"] - name: Loopback1 - description: VTEP - enabled: true - - device: ["leaf5"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf5"] - name: Loopback1 - description: VTEP - enabled: true - - device: ["leaf6"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf6"] - name: Loopback1 - description: VTEP - enabled: true - - device: ["leaf7"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf7"] - name: Loopback1 - description: VTEP - enabled: true - - device: ["leaf8"] - name: Loopback0 - description: Router-ID - enabled: true - - device: ["leaf8"] - name: Loopback1 - description: VTEP - enabled: true ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraInterfaceLag - data: - # Port-Channel999 — MLAG peer-link (all leafs) - - device: ["leaf1"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - - device: ["leaf2"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - - device: ["leaf3"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - - device: ["leaf4"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - - device: ["leaf5"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - - device: ["leaf6"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - - device: ["leaf7"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - - device: ["leaf8"] - name: Port-Channel999 - description: MLAG Peer - enabled: true - lacp_mode: active - # Port-Channel1 — Host-facing MLAG LAG (all leafs) - - device: ["leaf1"] - name: Port-Channel1 - description: host1 - enabled: true - lacp_mode: active - mlag_id: 1 - - device: ["leaf2"] - name: Port-Channel1 - description: host1 - enabled: true - lacp_mode: active - mlag_id: 1 - - device: ["leaf3"] - name: Port-Channel1 - description: host2 - enabled: true - lacp_mode: active - mlag_id: 1 - - device: ["leaf4"] - name: Port-Channel1 - description: host2 - enabled: true - lacp_mode: active - mlag_id: 1 - - device: ["leaf5"] - name: Port-Channel1 - description: host3 - enabled: true - lacp_mode: active - mlag_id: 1 - - device: ["leaf6"] - name: Port-Channel1 - description: host3 - enabled: true - lacp_mode: active - mlag_id: 1 - - device: ["leaf7"] - name: Port-Channel1 - description: host4 - enabled: true - lacp_mode: active - mlag_id: 1 - - device: ["leaf8"] - name: Port-Channel1 - description: host4 - enabled: true - lacp_mode: active - mlag_id: 1 ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraInterfaceEthernet - data: - # ============================================================ - # Spine1 Ethernet interfaces (underlay to leafs) - # ============================================================ - - device: ["spine1"] - name: Ethernet1 - description: leaf1 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine1"] - name: Ethernet2 - description: leaf2 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine1"] - name: Ethernet3 - description: leaf3 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine1"] - name: Ethernet4 - description: leaf4 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine1"] - name: Ethernet5 - description: leaf5 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine1"] - name: Ethernet6 - description: leaf6 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine1"] - name: Ethernet7 - description: leaf7 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine1"] - name: Ethernet8 - description: leaf8 - enabled: true - mtu: 9214 - mode: routed - # ============================================================ - # Spine2 Ethernet interfaces (underlay to leafs) - # ============================================================ - - device: ["spine2"] - name: Ethernet1 - description: leaf1 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine2"] - name: Ethernet2 - description: leaf2 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine2"] - name: Ethernet3 - description: leaf3 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine2"] - name: Ethernet4 - description: leaf4 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine2"] - name: Ethernet5 - description: leaf5 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine2"] - name: Ethernet6 - description: leaf6 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine2"] - name: Ethernet7 - description: leaf7 - enabled: true - mtu: 9214 - mode: routed - - device: ["spine2"] - name: Ethernet8 - description: leaf8 - enabled: true - mtu: 9214 - mode: routed - # ============================================================ - # Leaf Ethernet interfaces - # Each leaf has: Ethernet1 (host), Ethernet10 (mlag peer-link), - # Ethernet11 (spine1), Ethernet12 (spine2) - # ============================================================ - # Leaf1 - - device: ["leaf1"] - name: Ethernet1 - description: host1 - enabled: true - mode: trunk - lag: ["leaf1", "Port-Channel1"] - - device: ["leaf1"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf1", "Port-Channel999"] - - device: ["leaf1"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf1"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed - # Leaf2 - - device: ["leaf2"] - name: Ethernet1 - description: host1 - enabled: true - mode: trunk - lag: ["leaf2", "Port-Channel1"] - - device: ["leaf2"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf2", "Port-Channel999"] - - device: ["leaf2"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf2"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed - # Leaf3 - - device: ["leaf3"] - name: Ethernet1 - description: host2 - enabled: true - mode: trunk - lag: ["leaf3", "Port-Channel1"] - - device: ["leaf3"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf3", "Port-Channel999"] - - device: ["leaf3"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf3"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed - # Leaf4 - - device: ["leaf4"] - name: Ethernet1 - description: host2 - enabled: true - mode: trunk - lag: ["leaf4", "Port-Channel1"] - - device: ["leaf4"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf4", "Port-Channel999"] - - device: ["leaf4"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf4"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed - # Leaf5 - - device: ["leaf5"] - name: Ethernet1 - description: host3 - enabled: true - mode: trunk - lag: ["leaf5", "Port-Channel1"] - - device: ["leaf5"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf5", "Port-Channel999"] - - device: ["leaf5"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf5"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed - # Leaf6 - - device: ["leaf6"] - name: Ethernet1 - description: host3 - enabled: true - mode: trunk - lag: ["leaf6", "Port-Channel1"] - - device: ["leaf6"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf6", "Port-Channel999"] - - device: ["leaf6"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf6"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed - # Leaf7 - - device: ["leaf7"] - name: Ethernet1 - description: host4 - enabled: true - mode: trunk - lag: ["leaf7", "Port-Channel1"] - - device: ["leaf7"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf7", "Port-Channel999"] - - device: ["leaf7"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf7"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed - # Leaf8 - - device: ["leaf8"] - name: Ethernet1 - description: host4 - enabled: true - mode: trunk - lag: ["leaf8", "Port-Channel1"] - - device: ["leaf8"] - name: Ethernet10 - description: mlag peer link - enabled: true - mode: trunk - lag: ["leaf8", "Port-Channel999"] - - device: ["leaf8"] - name: Ethernet11 - description: spine1 - enabled: true - mtu: 9214 - mode: routed - - device: ["leaf8"] - name: Ethernet12 - description: spine2 - enabled: true - mtu: 9214 - mode: routed diff --git a/infrahub/objects/05-ipam.yml b/infrahub/objects/05-ipam.yml deleted file mode 100644 index 12ebcf1..0000000 --- a/infrahub/objects/05-ipam.yml +++ /dev/null @@ -1,131 +0,0 @@ -# IP Addresses: Loopbacks, P2P underlay links, MLAG SVIs, VRF SVIs -# Depends on: 03-interfaces ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraIPAddress - data: - # ============================================================ - # Loopback0 addresses (Router-ID) — /32 - # ============================================================ - - address: "10.0.250.1/32" - description: spine1 Router-ID - - address: "10.0.250.2/32" - description: spine2 Router-ID - - address: "10.0.250.11/32" - description: leaf1 Router-ID - - address: "10.0.250.12/32" - description: leaf2 Router-ID - - address: "10.0.250.13/32" - description: leaf3 Router-ID - - address: "10.0.250.14/32" - description: leaf4 Router-ID - - address: "10.0.250.15/32" - description: leaf5 Router-ID - - address: "10.0.250.16/32" - description: leaf6 Router-ID - - address: "10.0.250.17/32" - description: leaf7 Router-ID - - address: "10.0.250.18/32" - description: leaf8 Router-ID - # ============================================================ - # Loopback1 addresses (VTEP) — /32 - # ============================================================ - - address: "10.0.255.11/32" - description: leaf1 VTEP (shared VTEP1) - - address: "10.0.255.11/32" - description: leaf2 VTEP (shared VTEP1) - - address: "10.0.255.12/32" - description: leaf3 VTEP (shared VTEP2) - - address: "10.0.255.12/32" - description: leaf4 VTEP (shared VTEP2) - - address: "10.0.255.13/32" - description: leaf5 VTEP (shared VTEP3) - - address: "10.0.255.13/32" - description: leaf6 VTEP (shared VTEP3) - - address: "10.0.255.14/32" - description: leaf7 VTEP (shared VTEP4) - - address: "10.0.255.14/32" - description: leaf8 VTEP (shared VTEP4) - # ============================================================ - # Spine1 P2P underlay — /31 - # ============================================================ - - address: "10.0.1.0/31" - description: spine1 Ethernet1 to leaf1 - - address: "10.0.1.2/31" - description: spine1 Ethernet2 to leaf2 - - address: "10.0.1.4/31" - description: spine1 Ethernet3 to leaf3 - - address: "10.0.1.6/31" - description: spine1 Ethernet4 to leaf4 - - address: "10.0.1.8/31" - description: spine1 Ethernet5 to leaf5 - - address: "10.0.1.10/31" - description: spine1 Ethernet6 to leaf6 - - address: "10.0.1.12/31" - description: spine1 Ethernet7 to leaf7 - - address: "10.0.1.14/31" - description: spine1 Ethernet8 to leaf8 - # ============================================================ - # Spine2 P2P underlay — /31 - # ============================================================ - - address: "10.0.2.0/31" - description: spine2 Ethernet1 to leaf1 - - address: "10.0.2.2/31" - description: spine2 Ethernet2 to leaf2 - - address: "10.0.2.4/31" - description: spine2 Ethernet3 to leaf3 - - address: "10.0.2.6/31" - description: spine2 Ethernet4 to leaf4 - - address: "10.0.2.8/31" - description: spine2 Ethernet5 to leaf5 - - address: "10.0.2.10/31" - description: spine2 Ethernet6 to leaf6 - - address: "10.0.2.12/31" - description: spine2 Ethernet7 to leaf7 - - address: "10.0.2.14/31" - description: spine2 Ethernet8 to leaf8 - # ============================================================ - # Leaf P2P underlay (leaf side) — /31 - # ============================================================ - # Leaf1 - - address: "10.0.1.1/31" - description: leaf1 Ethernet11 to spine1 - - address: "10.0.2.1/31" - description: leaf1 Ethernet12 to spine2 - # Leaf2 - - address: "10.0.1.3/31" - description: leaf2 Ethernet11 to spine1 - - address: "10.0.2.3/31" - description: leaf2 Ethernet12 to spine2 - # Leaf3 - - address: "10.0.1.5/31" - description: leaf3 Ethernet11 to spine1 - - address: "10.0.2.5/31" - description: leaf3 Ethernet12 to spine2 - # Leaf4 - - address: "10.0.1.7/31" - description: leaf4 Ethernet11 to spine1 - - address: "10.0.2.7/31" - description: leaf4 Ethernet12 to spine2 - # Leaf5 - - address: "10.0.1.9/31" - description: leaf5 Ethernet11 to spine1 - - address: "10.0.2.9/31" - description: leaf5 Ethernet12 to spine2 - # Leaf6 - - address: "10.0.1.11/31" - description: leaf6 Ethernet11 to spine1 - - address: "10.0.2.11/31" - description: leaf6 Ethernet12 to spine2 - # Leaf7 - - address: "10.0.1.13/31" - description: leaf7 Ethernet11 to spine1 - - address: "10.0.2.13/31" - description: leaf7 Ethernet12 to spine2 - # Leaf8 - - address: "10.0.1.15/31" - description: leaf8 Ethernet11 to spine1 - - address: "10.0.2.15/31" - description: leaf8 Ethernet12 to spine2 diff --git a/infrahub/objects/06-vlans-vxlan.yml b/infrahub/objects/06-vlans-vxlan.yml deleted file mode 100644 index b516a79..0000000 --- a/infrahub/objects/06-vlans-vxlan.yml +++ /dev/null @@ -1,175 +0,0 @@ -# VLANs, VNIs, VTEPs, VLAN-VNI mappings, EVPN instances -# Depends on: 02-devices, 03-interfaces ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraVLAN - data: - - vlan_id: 34 - name: vrf-gold-subnet - description: VRF gold L3 subnet (leaf3/leaf4) - status: active - vlan_type: standard - - vlan_id: 40 - name: test-l2-vxlan - description: L2 VXLAN test VLAN - status: active - vlan_type: standard - - vlan_id: 78 - name: vrf-gold-subnet - description: VRF gold L3 subnet (leaf7/leaf8) - status: active - vlan_type: standard - - vlan_id: 900 - name: bgp-border - description: BGP border peering VLAN - status: active - vlan_type: standard - - vlan_id: 4090 - name: mlag-peer - description: MLAG peer-link control - status: active - vlan_type: mlag_peer - trunk_groups: - - mlag-peer - stp_enabled: false - - vlan_id: 4091 - name: mlag-ibgp - description: MLAG iBGP peering - status: active - vlan_type: mlag_ibgp - trunk_groups: - - mlag-peer - stp_enabled: false ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraVNI - data: - - vni: 110040 - description: L2VNI for VLAN 40 (test-l2-vxlan) - vni_type: l2vni - vlan: ["40"] - - vni: 100001 - description: L3VNI for VRF gold - vni_type: l3vni ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraVTEP - data: - # VTEP on leaf1 (shared VTEP1 IP 10.0.255.11) - - device: ["leaf1"] - source_address: "10.0.255.11" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf1", "Loopback1"] - # VTEP on leaf2 (shared VTEP1 IP 10.0.255.11) - - device: ["leaf2"] - source_address: "10.0.255.11" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf2", "Loopback1"] - # VTEP on leaf3 (shared VTEP2 IP 10.0.255.12) - - device: ["leaf3"] - source_address: "10.0.255.12" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf3", "Loopback1"] - # VTEP on leaf4 (shared VTEP2 IP 10.0.255.12) - - device: ["leaf4"] - source_address: "10.0.255.12" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf4", "Loopback1"] - # VTEP on leaf5 (shared VTEP3 IP 10.0.255.13) - - device: ["leaf5"] - source_address: "10.0.255.13" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf5", "Loopback1"] - # VTEP on leaf6 (shared VTEP3 IP 10.0.255.13) - - device: ["leaf6"] - source_address: "10.0.255.13" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf6", "Loopback1"] - # VTEP on leaf7 (shared VTEP4 IP 10.0.255.14) - - device: ["leaf7"] - source_address: "10.0.255.14" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf7", "Loopback1"] - # VTEP on leaf8 (shared VTEP4 IP 10.0.255.14) - - device: ["leaf8"] - source_address: "10.0.255.14" - udp_port: 4789 - learn_restrict: any - source_interface: ["leaf8", "Loopback1"] ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraVlanVniMapping - data: - # VLAN 40 <-> VNI 110040 on leaf1/2/5/6 (L2 VXLAN leafs) - - local_identifier: leaf1__vlan40__vni110040 - vtep: ["leaf1"] - vlan: ["40"] - vni: ["110040"] - description: "VLAN 40 <-> VNI 110040" - - local_identifier: leaf2__vlan40__vni110040 - vtep: ["leaf2"] - vlan: ["40"] - vni: ["110040"] - description: "VLAN 40 <-> VNI 110040" - - local_identifier: leaf5__vlan40__vni110040 - vtep: ["leaf5"] - vlan: ["40"] - vni: ["110040"] - description: "VLAN 40 <-> VNI 110040" - - local_identifier: leaf6__vlan40__vni110040 - vtep: ["leaf6"] - vlan: ["40"] - vni: ["110040"] - description: "VLAN 40 <-> VNI 110040" ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraEVPNInstance - data: - # EVPN instance for VLAN 40 on L2 VXLAN leafs - # leaf1: rd 65001:110040, rt both 40:110040 - - local_identifier: leaf1__vlan40 - device: ["leaf1"] - vlan: ["40"] - route_distinguisher: "65001:110040" - route_target_import: "40:110040" - route_target_export: "40:110040" - redistribute_learned: true - - local_identifier: leaf2__vlan40 - device: ["leaf2"] - vlan: ["40"] - route_distinguisher: "65001:110040" - route_target_import: "40:110040" - route_target_export: "40:110040" - redistribute_learned: true - # leaf5/6: rd 65003:110040, rt both 40:110040 - - local_identifier: leaf5__vlan40 - device: ["leaf5"] - vlan: ["40"] - route_distinguisher: "65003:110040" - route_target_import: "40:110040" - route_target_export: "40:110040" - redistribute_learned: true - - local_identifier: leaf6__vlan40 - device: ["leaf6"] - vlan: ["40"] - route_distinguisher: "65003:110040" - route_target_import: "40:110040" - route_target_export: "40:110040" - redistribute_learned: true diff --git a/infrahub/objects/07-interface-vlans.yml b/infrahub/objects/07-interface-vlans.yml deleted file mode 100644 index 2abddd1..0000000 --- a/infrahub/objects/07-interface-vlans.yml +++ /dev/null @@ -1,143 +0,0 @@ -# VLAN SVI interfaces -# Depends on: 03-devices, 06-vlans-vxlan (VLANs must exist) ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraInterfaceVlan - data: - # Vlan4090 — MLAG Peer-Link SVI (all leafs) - - device: ["leaf1"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - - device: ["leaf2"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - - device: ["leaf3"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - - device: ["leaf4"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - - device: ["leaf5"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - - device: ["leaf6"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - - device: ["leaf7"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - - device: ["leaf8"] - name: Vlan4090 - description: MLAG Peer-Link - enabled: true - autostate: false - vlan: ["4090"] - # Vlan4091 — MLAG iBGP Peering SVI (all leafs) - - device: ["leaf1"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - - device: ["leaf2"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - - device: ["leaf3"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - - device: ["leaf4"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - - device: ["leaf5"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - - device: ["leaf6"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - - device: ["leaf7"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - - device: ["leaf8"] - name: Vlan4091 - description: MLAG iBGP Peering - enabled: true - mtu: 9214 - vlan: ["4091"] - # Vlan34 — VRF gold subnet (leaf3/leaf4) - - device: ["leaf3"] - name: Vlan34 - description: VRF gold subnet - enabled: true - virtual_router_address: "10.34.34.1" - vlan: ["34"] - - device: ["leaf4"] - name: Vlan34 - description: VRF gold subnet - enabled: true - virtual_router_address: "10.34.34.1" - vlan: ["34"] - # Vlan78 — VRF gold subnet (leaf7/leaf8) - - device: ["leaf7"] - name: Vlan78 - description: VRF gold subnet - enabled: true - virtual_router_address: "10.78.78.1" - vlan: ["78"] - - device: ["leaf8"] - name: Vlan78 - description: VRF gold subnet - enabled: true - virtual_router_address: "10.78.78.1" - vlan: ["78"] - # Vlan900 — BGP border peering (leaf7/leaf8) - - device: ["leaf7"] - name: Vlan900 - description: BGP border peering - enabled: true - vlan: ["900"] - - device: ["leaf8"] - name: Vlan900 - description: BGP border peering - enabled: true - vlan: ["900"] diff --git a/infrahub/objects/08-ipam-vlans.yml b/infrahub/objects/08-ipam-vlans.yml deleted file mode 100644 index 759a1f2..0000000 --- a/infrahub/objects/08-ipam-vlans.yml +++ /dev/null @@ -1,64 +0,0 @@ -# IP Addresses for VLAN SVI interfaces -# Depends on: 07-interface-vlans (Vlan SVIs must exist) ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraIPAddress - data: - # ============================================================ - # MLAG Peer-Link SVI (Vlan4090) — /31 - # ============================================================ - - address: "10.0.199.254/31" - description: leaf1 MLAG peer-link - - address: "10.0.199.255/31" - description: leaf2 MLAG peer-link - - address: "10.0.199.252/31" - description: leaf3 MLAG peer-link - - address: "10.0.199.253/31" - description: leaf4 MLAG peer-link - - address: "10.0.199.250/31" - description: leaf5 MLAG peer-link - - address: "10.0.199.251/31" - description: leaf6 MLAG peer-link - - address: "10.0.199.248/31" - description: leaf7 MLAG peer-link - - address: "10.0.199.249/31" - description: leaf8 MLAG peer-link - # ============================================================ - # MLAG iBGP Peering SVI (Vlan4091) — /31 - # ============================================================ - - address: "10.0.3.0/31" - description: leaf1 MLAG iBGP peering - - address: "10.0.3.1/31" - description: leaf2 MLAG iBGP peering - - address: "10.0.3.2/31" - description: leaf3 MLAG iBGP peering - - address: "10.0.3.3/31" - description: leaf4 MLAG iBGP peering - - address: "10.0.3.4/31" - description: leaf5 MLAG iBGP peering - - address: "10.0.3.5/31" - description: leaf6 MLAG iBGP peering - - address: "10.0.3.6/31" - description: leaf7 MLAG iBGP peering - - address: "10.0.3.7/31" - description: leaf8 MLAG iBGP peering - # ============================================================ - # VRF gold SVI addresses — /24 - # ============================================================ - # Vlan34 (leaf3/leaf4) - - address: "10.34.34.2/24" - description: leaf3 Vlan34 VRF gold - - address: "10.34.34.3/24" - description: leaf4 Vlan34 VRF gold - # Vlan78 (leaf7/leaf8) - - address: "10.78.78.2/24" - description: leaf7 Vlan78 VRF gold - - address: "10.78.78.3/24" - description: leaf8 Vlan78 VRF gold - # Vlan900 — BGP border (leaf7/leaf8) - - address: "10.90.90.2/29" - description: leaf7 Vlan900 BGP border - - address: "10.90.90.3/29" - description: leaf8 Vlan900 BGP border diff --git a/infrahub/objects/09-bgp.yml b/infrahub/objects/09-bgp.yml deleted file mode 100644 index c9c7d31..0000000 --- a/infrahub/objects/09-bgp.yml +++ /dev/null @@ -1,411 +0,0 @@ -# BGP: RouterConfig, PeerGroups, Sessions, AddressFamilies -# Depends on: 01-foundation (ASNs), 02-devices, 04-ipam -# -# Spine BGP: no named peer-groups in config (neighbors defined directly), -# but evpn peer-group is defined. Underlay neighbors are direct. -# Leaf BGP: underlay, underlay_ibgp, evpn peer-groups. ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraBGPRouterConfig - data: - # ============================================================ - # Spine1 BGP — AS 65000, router-id 10.0.250.1 - # ============================================================ - - device: ["spine1"] - router_id: "10.0.250.1" - local_asn: ["65000"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Spine2 BGP — AS 65000, router-id 10.0.250.2 - # ============================================================ - - device: ["spine2"] - router_id: "10.0.250.2" - local_asn: ["65000"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf1 BGP — AS 65001, router-id 10.0.250.11 - # ============================================================ - - device: ["leaf1"] - router_id: "10.0.250.11" - local_asn: ["65001"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf2 BGP — AS 65001, router-id 10.0.250.12 - # ============================================================ - - device: ["leaf2"] - router_id: "10.0.250.12" - local_asn: ["65001"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf3 BGP — AS 65002, router-id 10.0.250.13 - # ============================================================ - - device: ["leaf3"] - router_id: "10.0.250.13" - local_asn: ["65002"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf4 BGP — AS 65002, router-id 10.0.250.14 - # ============================================================ - - device: ["leaf4"] - router_id: "10.0.250.14" - local_asn: ["65002"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf5 BGP — AS 65003, router-id 10.0.250.15 - # ============================================================ - - device: ["leaf5"] - router_id: "10.0.250.15" - local_asn: ["65003"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf6 BGP — AS 65003, router-id 10.0.250.16 - # ============================================================ - - device: ["leaf6"] - router_id: "10.0.250.16" - local_asn: ["65003"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf7 BGP — AS 65004, router-id 10.0.250.17 - # ============================================================ - - device: ["leaf7"] - router_id: "10.0.250.17" - local_asn: ["65004"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 - # ============================================================ - # Leaf8 BGP — AS 65004, router-id 10.0.250.18 - # ============================================================ - - device: ["leaf8"] - router_id: "10.0.250.18" - local_asn: ["65004"] - default_ipv4_unicast: false - log_neighbor_changes: true - ecmp_max_paths: 4 - ecmp_max_ecmp: 64 - ebgp_distance: 20 - ibgp_distance: 200 - local_distance: 200 ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraBGPPeerGroup - data: - # ============================================================ - # Spine peer-groups (evpn only — underlay neighbors are direct) - # ============================================================ - # Spine1 — evpn peer-group - - bgp_config: ["spine1"] - local_identifier: "spine1__evpn" - name: evpn - description: EVPN overlay to leaf loopbacks - peer_group_type: evpn - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - next_hop_unchanged: true - maximum_routes: 12000 - 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 - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - next_hop_unchanged: true - maximum_routes: 12000 - maximum_routes_warning_only: true - # ============================================================ - # Leaf peer-groups (underlay, underlay_ibgp, evpn) - # ============================================================ - # Leaf1 - - bgp_config: ["leaf1"] - local_identifier: "leaf1__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65001"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - # Leaf2 - - bgp_config: ["leaf2"] - local_identifier: "leaf2__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65001"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - # Leaf3 - - bgp_config: ["leaf3"] - local_identifier: "leaf3__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65002"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - # Leaf4 - - bgp_config: ["leaf4"] - local_identifier: "leaf4__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65002"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - # Leaf5 - - bgp_config: ["leaf5"] - local_identifier: "leaf5__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65003"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - # Leaf6 - - bgp_config: ["leaf6"] - local_identifier: "leaf6__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65003"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - # Leaf7 - - bgp_config: ["leaf7"] - local_identifier: "leaf7__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65004"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - # Leaf8 - - bgp_config: ["leaf8"] - local_identifier: "leaf8__underlay" - name: underlay - description: Underlay eBGP to spines - peer_group_type: underlay - remote_asn: ["65000"] - 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 - remote_asn: ["65004"] - next_hop_self: true - 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 - remote_asn: ["65000"] - update_source: Loopback0 - ebgp_multihop: 3 - send_community: extended - maximum_routes: 12000 - maximum_routes_warning_only: true - diff --git a/infrahub/objects/10-vrfs.yml b/infrahub/objects/10-vrfs.yml deleted file mode 100644 index 9f5adb6..0000000 --- a/infrahub/objects/10-vrfs.yml +++ /dev/null @@ -1,62 +0,0 @@ -# VRFs, Route Targets, VRF Device Assignments -# Depends on: 02-devices, 03-interfaces, 05-vlans-vxlan (VNI 100001) -# -# VRF gold is used on leaf3/4 (VLAN 34) and leaf7/8 (VLAN 78 + border) -# L3VNI 100001 for symmetric IRB -# Route targets: import/export evpn 1:100001 -# Per-device RD: :1 ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraRouteTarget - data: - - target: "1:100001" - description: VRF gold EVPN route target ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraVRF - data: - - name: gold - description: VRF gold - L3 VXLAN with symmetric IRB - l3vni: ["100001"] - import_targets: - - ["1:100001"] - export_targets: - - ["1:100001"] ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraVRFDeviceAssignment - data: - - device: ["leaf3"] - vrf: ["gold"] - route_distinguisher: "10.0.250.13:1" - import_targets: - - ["1:100001"] - export_targets: - - ["1:100001"] - - device: ["leaf4"] - vrf: ["gold"] - route_distinguisher: "10.0.250.14:1" - import_targets: - - ["1:100001"] - export_targets: - - ["1:100001"] - - device: ["leaf7"] - vrf: ["gold"] - route_distinguisher: "10.0.250.17:1" - import_targets: - - ["1:100001"] - export_targets: - - ["1:100001"] - - device: ["leaf8"] - vrf: ["gold"] - route_distinguisher: "10.0.250.18:1" - import_targets: - - ["1:100001"] - export_targets: - - ["1:100001"] diff --git a/infrahub/objects/11-bgp-sessions.yml b/infrahub/objects/11-bgp-sessions.yml deleted file mode 100644 index 458ae32..0000000 --- a/infrahub/objects/11-bgp-sessions.yml +++ /dev/null @@ -1,748 +0,0 @@ -# BGP Sessions and Address Families -# Depends on: 09-bgp (RouterConfig and PeerGroups must exist), 10-vrfs (InfraVRF must exist before VRF references) ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraBGPSession - data: - # ============================================================ - # Spine1 sessions - # ============================================================ - # Spine1 underlay (direct neighbors, no peer-group — use remote_asn) - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.1" - peer_address: "10.0.1.1" - description: "underlay to leaf1" - remote_asn: ["65001"] - peer_device: ["leaf1"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.3" - peer_address: "10.0.1.3" - description: "underlay to leaf2" - remote_asn: ["65001"] - peer_device: ["leaf2"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.5" - peer_address: "10.0.1.5" - description: "underlay to leaf3" - remote_asn: ["65002"] - peer_device: ["leaf3"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.7" - peer_address: "10.0.1.7" - description: "underlay to leaf4" - remote_asn: ["65002"] - peer_device: ["leaf4"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.9" - peer_address: "10.0.1.9" - description: "underlay to leaf5" - remote_asn: ["65003"] - peer_device: ["leaf5"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.11" - peer_address: "10.0.1.11" - description: "underlay to leaf6" - remote_asn: ["65003"] - peer_device: ["leaf6"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.13" - peer_address: "10.0.1.13" - description: "underlay to leaf7" - remote_asn: ["65004"] - peer_device: ["leaf7"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.1.15" - peer_address: "10.0.1.15" - description: "underlay to leaf8" - remote_asn: ["65004"] - peer_device: ["leaf8"] - # Spine1 EVPN (via evpn peer-group) - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.11" - peer_address: "10.0.250.11" - description: "EVPN to leaf1" - peer_group: "spine1__evpn" - remote_asn: ["65001"] - peer_device: ["leaf1"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.12" - peer_address: "10.0.250.12" - description: "EVPN to leaf2" - peer_group: "spine1__evpn" - remote_asn: ["65001"] - peer_device: ["leaf2"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.13" - peer_address: "10.0.250.13" - description: "EVPN to leaf3" - peer_group: "spine1__evpn" - remote_asn: ["65002"] - peer_device: ["leaf3"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.14" - peer_address: "10.0.250.14" - description: "EVPN to leaf4" - peer_group: "spine1__evpn" - remote_asn: ["65002"] - peer_device: ["leaf4"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.15" - peer_address: "10.0.250.15" - description: "EVPN to leaf5" - peer_group: "spine1__evpn" - remote_asn: ["65003"] - peer_device: ["leaf5"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.16" - peer_address: "10.0.250.16" - description: "EVPN to leaf6" - peer_group: "spine1__evpn" - remote_asn: ["65003"] - peer_device: ["leaf6"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.17" - peer_address: "10.0.250.17" - description: "EVPN to leaf7" - peer_group: "spine1__evpn" - remote_asn: ["65004"] - peer_device: ["leaf7"] - - bgp_config: ["spine1"] - local_identifier: "spine1__10.0.250.18" - peer_address: "10.0.250.18" - description: "EVPN to leaf8" - peer_group: "spine1__evpn" - remote_asn: ["65004"] - peer_device: ["leaf8"] - # ============================================================ - # Spine2 sessions - # ============================================================ - # Spine2 underlay - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.1" - peer_address: "10.0.2.1" - description: "underlay to leaf1" - remote_asn: ["65001"] - peer_device: ["leaf1"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.3" - peer_address: "10.0.2.3" - description: "underlay to leaf2" - remote_asn: ["65001"] - peer_device: ["leaf2"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.5" - peer_address: "10.0.2.5" - description: "underlay to leaf3" - remote_asn: ["65002"] - peer_device: ["leaf3"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.7" - peer_address: "10.0.2.7" - description: "underlay to leaf4" - remote_asn: ["65002"] - peer_device: ["leaf4"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.9" - peer_address: "10.0.2.9" - description: "underlay to leaf5" - remote_asn: ["65003"] - peer_device: ["leaf5"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.11" - peer_address: "10.0.2.11" - description: "underlay to leaf6" - remote_asn: ["65003"] - peer_device: ["leaf6"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.13" - peer_address: "10.0.2.13" - description: "underlay to leaf7" - remote_asn: ["65004"] - peer_device: ["leaf7"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.2.15" - peer_address: "10.0.2.15" - description: "underlay to leaf8" - remote_asn: ["65004"] - peer_device: ["leaf8"] - # Spine2 EVPN - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.11" - peer_address: "10.0.250.11" - description: "EVPN to leaf1" - peer_group: "spine2__evpn" - remote_asn: ["65001"] - peer_device: ["leaf1"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.12" - peer_address: "10.0.250.12" - description: "EVPN to leaf2" - peer_group: "spine2__evpn" - remote_asn: ["65001"] - peer_device: ["leaf2"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.13" - peer_address: "10.0.250.13" - description: "EVPN to leaf3" - peer_group: "spine2__evpn" - remote_asn: ["65002"] - peer_device: ["leaf3"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.14" - peer_address: "10.0.250.14" - description: "EVPN to leaf4" - peer_group: "spine2__evpn" - remote_asn: ["65002"] - peer_device: ["leaf4"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.15" - peer_address: "10.0.250.15" - description: "EVPN to leaf5" - peer_group: "spine2__evpn" - remote_asn: ["65003"] - peer_device: ["leaf5"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.16" - peer_address: "10.0.250.16" - description: "EVPN to leaf6" - peer_group: "spine2__evpn" - remote_asn: ["65003"] - peer_device: ["leaf6"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.17" - peer_address: "10.0.250.17" - description: "EVPN to leaf7" - peer_group: "spine2__evpn" - remote_asn: ["65004"] - peer_device: ["leaf7"] - - bgp_config: ["spine2"] - local_identifier: "spine2__10.0.250.18" - peer_address: "10.0.250.18" - description: "EVPN to leaf8" - peer_group: "spine2__evpn" - remote_asn: ["65004"] - peer_device: ["leaf8"] - # ============================================================ - # Leaf1 sessions - # ============================================================ - - bgp_config: ["leaf1"] - local_identifier: "leaf1__10.0.1.0" - peer_address: "10.0.1.0" - description: "underlay to spine1" - peer_group: "leaf1__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf1"] - local_identifier: "leaf1__10.0.2.0" - peer_address: "10.0.2.0" - description: "underlay to spine2" - peer_group: "leaf1__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf1"] - local_identifier: "leaf1__10.0.3.1" - peer_address: "10.0.3.1" - description: "iBGP to leaf2" - peer_group: "leaf1__underlay_ibgp" - peer_device: ["leaf2"] - - bgp_config: ["leaf1"] - local_identifier: "leaf1__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf1__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf1"] - local_identifier: "leaf1__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf1__evpn" - peer_device: ["spine2"] - # ============================================================ - # Leaf2 sessions - # ============================================================ - - bgp_config: ["leaf2"] - local_identifier: "leaf2__10.0.1.2" - peer_address: "10.0.1.2" - description: "underlay to spine1" - peer_group: "leaf2__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf2"] - local_identifier: "leaf2__10.0.2.2" - peer_address: "10.0.2.2" - description: "underlay to spine2" - peer_group: "leaf2__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf2"] - local_identifier: "leaf2__10.0.3.0" - peer_address: "10.0.3.0" - description: "iBGP to leaf1" - peer_group: "leaf2__underlay_ibgp" - peer_device: ["leaf1"] - - bgp_config: ["leaf2"] - local_identifier: "leaf2__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf2__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf2"] - local_identifier: "leaf2__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf2__evpn" - peer_device: ["spine2"] - # ============================================================ - # Leaf3 sessions - # ============================================================ - - bgp_config: ["leaf3"] - local_identifier: "leaf3__10.0.1.4" - peer_address: "10.0.1.4" - description: "underlay to spine1" - peer_group: "leaf3__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf3"] - local_identifier: "leaf3__10.0.2.4" - peer_address: "10.0.2.4" - description: "underlay to spine2" - peer_group: "leaf3__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf3"] - local_identifier: "leaf3__10.0.3.3" - peer_address: "10.0.3.3" - description: "iBGP to leaf4" - peer_group: "leaf3__underlay_ibgp" - peer_device: ["leaf4"] - - bgp_config: ["leaf3"] - local_identifier: "leaf3__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf3__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf3"] - local_identifier: "leaf3__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf3__evpn" - peer_device: ["spine2"] - # ============================================================ - # Leaf4 sessions - # ============================================================ - - bgp_config: ["leaf4"] - local_identifier: "leaf4__10.0.1.6" - peer_address: "10.0.1.6" - description: "underlay to spine1" - peer_group: "leaf4__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf4"] - local_identifier: "leaf4__10.0.2.6" - peer_address: "10.0.2.6" - description: "underlay to spine2" - peer_group: "leaf4__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf4"] - local_identifier: "leaf4__10.0.3.2" - peer_address: "10.0.3.2" - description: "iBGP to leaf3" - peer_group: "leaf4__underlay_ibgp" - peer_device: ["leaf3"] - - bgp_config: ["leaf4"] - local_identifier: "leaf4__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf4__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf4"] - local_identifier: "leaf4__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf4__evpn" - peer_device: ["spine2"] - # ============================================================ - # Leaf5 sessions - # ============================================================ - - bgp_config: ["leaf5"] - local_identifier: "leaf5__10.0.1.8" - peer_address: "10.0.1.8" - description: "underlay to spine1" - peer_group: "leaf5__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf5"] - local_identifier: "leaf5__10.0.2.8" - peer_address: "10.0.2.8" - description: "underlay to spine2" - peer_group: "leaf5__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf5"] - local_identifier: "leaf5__10.0.3.5" - peer_address: "10.0.3.5" - description: "iBGP to leaf6" - peer_group: "leaf5__underlay_ibgp" - peer_device: ["leaf6"] - - bgp_config: ["leaf5"] - local_identifier: "leaf5__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf5__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf5"] - local_identifier: "leaf5__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf5__evpn" - peer_device: ["spine2"] - # ============================================================ - # Leaf6 sessions - # ============================================================ - - bgp_config: ["leaf6"] - local_identifier: "leaf6__10.0.1.10" - peer_address: "10.0.1.10" - description: "underlay to spine1" - peer_group: "leaf6__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf6"] - local_identifier: "leaf6__10.0.2.10" - peer_address: "10.0.2.10" - description: "underlay to spine2" - peer_group: "leaf6__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf6"] - local_identifier: "leaf6__10.0.3.4" - peer_address: "10.0.3.4" - description: "iBGP to leaf5" - peer_group: "leaf6__underlay_ibgp" - peer_device: ["leaf5"] - - bgp_config: ["leaf6"] - local_identifier: "leaf6__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf6__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf6"] - local_identifier: "leaf6__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf6__evpn" - peer_device: ["spine2"] - # ============================================================ - # Leaf7 sessions - # ============================================================ - - bgp_config: ["leaf7"] - local_identifier: "leaf7__10.0.1.12" - peer_address: "10.0.1.12" - description: "underlay to spine1" - peer_group: "leaf7__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf7"] - local_identifier: "leaf7__10.0.2.12" - peer_address: "10.0.2.12" - description: "underlay to spine2" - peer_group: "leaf7__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf7"] - local_identifier: "leaf7__10.0.3.7" - peer_address: "10.0.3.7" - description: "iBGP to leaf8" - peer_group: "leaf7__underlay_ibgp" - peer_device: ["leaf8"] - - bgp_config: ["leaf7"] - local_identifier: "leaf7__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf7__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf7"] - local_identifier: "leaf7__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf7__evpn" - peer_device: ["spine2"] - # Leaf7 VRF gold border peering - - bgp_config: ["leaf7"] - local_identifier: "leaf7__10.90.90.1" - peer_address: "10.90.90.1" - description: "border peering to AS 64999 in VRF gold" - remote_asn: ["64999"] - vrf: "gold" - # ============================================================ - # Leaf8 sessions - # ============================================================ - - bgp_config: ["leaf8"] - local_identifier: "leaf8__10.0.1.14" - peer_address: "10.0.1.14" - description: "underlay to spine1" - peer_group: "leaf8__underlay" - peer_device: ["spine1"] - - bgp_config: ["leaf8"] - local_identifier: "leaf8__10.0.2.14" - peer_address: "10.0.2.14" - description: "underlay to spine2" - peer_group: "leaf8__underlay" - peer_device: ["spine2"] - - bgp_config: ["leaf8"] - local_identifier: "leaf8__10.0.3.6" - peer_address: "10.0.3.6" - description: "iBGP to leaf7" - peer_group: "leaf8__underlay_ibgp" - peer_device: ["leaf7"] - - bgp_config: ["leaf8"] - local_identifier: "leaf8__10.0.250.1" - peer_address: "10.0.250.1" - description: "EVPN to spine1" - peer_group: "leaf8__evpn" - peer_device: ["spine1"] - - bgp_config: ["leaf8"] - local_identifier: "leaf8__10.0.250.2" - peer_address: "10.0.250.2" - description: "EVPN to spine2" - peer_group: "leaf8__evpn" - peer_device: ["spine2"] - # Leaf8 VRF gold border peering - - bgp_config: ["leaf8"] - local_identifier: "leaf8__10.90.90.1" - peer_address: "10.90.90.1" - description: "border peering to AS 64999 in VRF gold" - remote_asn: ["64999"] - vrf: "gold" ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraBGPAddressFamily - data: - # ============================================================ - # Spine1 address families - # ============================================================ - - bgp_config: ["spine1"] - device: ["spine1"] - local_identifier: "spine1__ipv4_unicast" - afi: ipv4 - safi: unicast - active_sessions: - - ["spine1__10.0.1.1"] - - ["spine1__10.0.1.3"] - - ["spine1__10.0.1.5"] - - ["spine1__10.0.1.7"] - - ["spine1__10.0.1.9"] - - ["spine1__10.0.1.11"] - - ["spine1__10.0.1.13"] - - ["spine1__10.0.1.15"] - networks: - - ["10.0.250.1/32"] - - bgp_config: ["spine1"] - device: ["spine1"] - local_identifier: "spine1__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["spine1__evpn"] - # ============================================================ - # Spine2 address families - # ============================================================ - - bgp_config: ["spine2"] - device: ["spine2"] - local_identifier: "spine2__ipv4_unicast" - afi: ipv4 - safi: unicast - active_sessions: - - ["spine2__10.0.2.1"] - - ["spine2__10.0.2.3"] - - ["spine2__10.0.2.5"] - - ["spine2__10.0.2.7"] - - ["spine2__10.0.2.9"] - - ["spine2__10.0.2.11"] - - ["spine2__10.0.2.13"] - - ["spine2__10.0.2.15"] - networks: - - ["10.0.250.2/32"] - - bgp_config: ["spine2"] - device: ["spine2"] - local_identifier: "spine2__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["spine2__evpn"] - # ============================================================ - # Leaf1 address families - # ============================================================ - - bgp_config: ["leaf1"] - device: ["leaf1"] - local_identifier: "leaf1__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf1__underlay"] - - ["leaf1__underlay_ibgp"] - networks: - - ["10.0.250.11/32"] - - ["10.0.255.11/32"] - - bgp_config: ["leaf1"] - device: ["leaf1"] - local_identifier: "leaf1__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf1__evpn"] - # ============================================================ - # Leaf2 address families - # ============================================================ - - bgp_config: ["leaf2"] - device: ["leaf2"] - local_identifier: "leaf2__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf2__underlay"] - - ["leaf2__underlay_ibgp"] - networks: - - ["10.0.250.12/32"] - - ["10.0.255.11/32"] - - bgp_config: ["leaf2"] - device: ["leaf2"] - local_identifier: "leaf2__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf2__evpn"] - # ============================================================ - # Leaf3 address families - # ============================================================ - - bgp_config: ["leaf3"] - device: ["leaf3"] - local_identifier: "leaf3__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf3__underlay"] - - ["leaf3__underlay_ibgp"] - networks: - - ["10.0.250.13/32"] - - ["10.0.255.12/32"] - - bgp_config: ["leaf3"] - device: ["leaf3"] - local_identifier: "leaf3__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf3__evpn"] - # ============================================================ - # Leaf4 address families - # ============================================================ - - bgp_config: ["leaf4"] - device: ["leaf4"] - local_identifier: "leaf4__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf4__underlay"] - - ["leaf4__underlay_ibgp"] - networks: - - ["10.0.250.14/32"] - - ["10.0.255.12/32"] - - bgp_config: ["leaf4"] - device: ["leaf4"] - local_identifier: "leaf4__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf4__evpn"] - # ============================================================ - # Leaf5 address families - # ============================================================ - - bgp_config: ["leaf5"] - device: ["leaf5"] - local_identifier: "leaf5__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf5__underlay"] - - ["leaf5__underlay_ibgp"] - networks: - - ["10.0.250.15/32"] - - ["10.0.255.13/32"] - - bgp_config: ["leaf5"] - device: ["leaf5"] - local_identifier: "leaf5__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf5__evpn"] - # ============================================================ - # Leaf6 address families - # ============================================================ - - bgp_config: ["leaf6"] - device: ["leaf6"] - local_identifier: "leaf6__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf6__underlay"] - - ["leaf6__underlay_ibgp"] - networks: - - ["10.0.250.16/32"] - - ["10.0.255.13/32"] - - bgp_config: ["leaf6"] - device: ["leaf6"] - local_identifier: "leaf6__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf6__evpn"] - # ============================================================ - # Leaf7 address families - # ============================================================ - - bgp_config: ["leaf7"] - device: ["leaf7"] - local_identifier: "leaf7__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf7__underlay"] - - ["leaf7__underlay_ibgp"] - networks: - - ["10.0.250.17/32"] - - ["10.0.255.14/32"] - - bgp_config: ["leaf7"] - device: ["leaf7"] - local_identifier: "leaf7__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf7__evpn"] - # Leaf7 IPv4 unicast in VRF gold (border peering) - - bgp_config: ["leaf7"] - device: ["leaf7"] - local_identifier: "leaf7__vrf_gold__ipv4_unicast" - afi: ipv4 - safi: unicast - vrf: "gold" - active_sessions: - - ["leaf7__10.90.90.1"] - # ============================================================ - # Leaf8 address families - # ============================================================ - - bgp_config: ["leaf8"] - device: ["leaf8"] - local_identifier: "leaf8__ipv4_unicast" - afi: ipv4 - safi: unicast - active_peer_groups: - - ["leaf8__underlay"] - - ["leaf8__underlay_ibgp"] - networks: - - ["10.0.250.18/32"] - - ["10.0.255.14/32"] - - bgp_config: ["leaf8"] - device: ["leaf8"] - local_identifier: "leaf8__evpn_unicast" - afi: evpn - safi: unicast - active_peer_groups: - - ["leaf8__evpn"] - # Leaf8 IPv4 unicast in VRF gold (border peering) - - bgp_config: ["leaf8"] - device: ["leaf8"] - local_identifier: "leaf8__vrf_gold__ipv4_unicast" - afi: ipv4 - safi: unicast - vrf: "gold" - active_sessions: - - ["leaf8__10.90.90.1"] diff --git a/infrahub/objects/12-mlag.yml b/infrahub/objects/12-mlag.yml deleted file mode 100644 index e1f460e..0000000 --- a/infrahub/objects/12-mlag.yml +++ /dev/null @@ -1,180 +0,0 @@ -# MLAG: Domains and Peer Configs -# Depends on: 02-devices, 03-interfaces (Vlan4090, Port-Channel999), 05-vlans-vxlan (VLAN 4090/4091) -# -# All 4 MLAG pairs share domain-id "leafs" and virtual-mac c001.cafe.babe -# but each is a separate MlagDomain object linking two devices. -# MLAG peer VLAN: 4090, MLAG iBGP VLAN: 4091 ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraMlagDomain - data: - # MLAG pair 1: leaf1 + leaf2 - - domain_id: leafs-1-2 - description: MLAG domain for leaf1/leaf2 pair - virtual_mac: "c001.cafe.babe" - heartbeat_vrf: mgmt - dual_primary_detection: true - dual_primary_delay: 10 - dual_primary_action: errdisable - devices: - - ["leaf1"] - - ["leaf2"] - peer_vlan: ["4090"] - ibgp_vlan: ["4091"] - # MLAG pair 2: leaf3 + leaf4 - - domain_id: leafs-3-4 - description: MLAG domain for leaf3/leaf4 pair - virtual_mac: "c001.cafe.babe" - heartbeat_vrf: mgmt - dual_primary_detection: true - dual_primary_delay: 10 - dual_primary_action: errdisable - devices: - - ["leaf3"] - - ["leaf4"] - peer_vlan: ["4090"] - ibgp_vlan: ["4091"] - # MLAG pair 3: leaf5 + leaf6 - - domain_id: leafs-5-6 - description: MLAG domain for leaf5/leaf6 pair - virtual_mac: "c001.cafe.babe" - heartbeat_vrf: mgmt - dual_primary_detection: true - dual_primary_delay: 10 - dual_primary_action: errdisable - devices: - - ["leaf5"] - - ["leaf6"] - peer_vlan: ["4090"] - ibgp_vlan: ["4091"] - # MLAG pair 4: leaf7 + leaf8 - - domain_id: leafs-7-8 - description: MLAG domain for leaf7/leaf8 pair - virtual_mac: "c001.cafe.babe" - heartbeat_vrf: mgmt - dual_primary_detection: true - dual_primary_delay: 10 - dual_primary_action: errdisable - devices: - - ["leaf7"] - - ["leaf8"] - peer_vlan: ["4090"] - ibgp_vlan: ["4091"] ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraMlagPeerConfig - data: - # Leaf1 MLAG peer config - - device: ["leaf1"] - mlag_domain: ["leafs-1-2"] - local_interface_ip: "10.0.199.254/31" - peer_address: "10.0.199.255" - heartbeat_peer_ip: "172.16.0.50" - local_interface: ["leaf1", "Vlan4090"] - peer_link: ["leaf1", "Port-Channel999"] - # Leaf2 MLAG peer config - - device: ["leaf2"] - mlag_domain: ["leafs-1-2"] - local_interface_ip: "10.0.199.255/31" - peer_address: "10.0.199.254" - heartbeat_peer_ip: "172.16.0.25" - local_interface: ["leaf2", "Vlan4090"] - peer_link: ["leaf2", "Port-Channel999"] - # Leaf3 MLAG peer config - - device: ["leaf3"] - mlag_domain: ["leafs-3-4"] - local_interface_ip: "10.0.199.252/31" - peer_address: "10.0.199.253" - heartbeat_peer_ip: "172.16.0.28" - local_interface: ["leaf3", "Vlan4090"] - peer_link: ["leaf3", "Port-Channel999"] - # Leaf4 MLAG peer config - - device: ["leaf4"] - mlag_domain: ["leafs-3-4"] - local_interface_ip: "10.0.199.253/31" - peer_address: "10.0.199.252" - heartbeat_peer_ip: "172.16.0.27" - local_interface: ["leaf4", "Vlan4090"] - peer_link: ["leaf4", "Port-Channel999"] - # Leaf5 MLAG peer config - - device: ["leaf5"] - mlag_domain: ["leafs-5-6"] - local_interface_ip: "10.0.199.250/31" - peer_address: "10.0.199.251" - heartbeat_peer_ip: "172.16.0.30" - local_interface: ["leaf5", "Vlan4090"] - peer_link: ["leaf5", "Port-Channel999"] - # Leaf6 MLAG peer config - - device: ["leaf6"] - mlag_domain: ["leafs-5-6"] - local_interface_ip: "10.0.199.251/31" - peer_address: "10.0.199.250" - heartbeat_peer_ip: "172.16.0.29" - local_interface: ["leaf6", "Vlan4090"] - peer_link: ["leaf6", "Port-Channel999"] - # Leaf7 MLAG peer config - - device: ["leaf7"] - mlag_domain: ["leafs-7-8"] - local_interface_ip: "10.0.199.248/31" - peer_address: "10.0.199.249" - heartbeat_peer_ip: "172.16.0.32" - local_interface: ["leaf7", "Vlan4090"] - peer_link: ["leaf7", "Port-Channel999"] - # Leaf8 MLAG peer config - - device: ["leaf8"] - mlag_domain: ["leafs-7-8"] - local_interface_ip: "10.0.199.249/31" - peer_address: "10.0.199.248" - heartbeat_peer_ip: "172.16.0.31" - local_interface: ["leaf8", "Vlan4090"] - peer_link: ["leaf8", "Port-Channel999"] ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraMlagInterface - data: - # MLAG interface 1 on leaf1/leaf2 pair (Port-Channel1 → host1) - - local_identifier: mlag1__leaf1-leaf2 - mlag_id: 1 - description: "MLAG interface 1 for leaf1/leaf2 pair (host1)" - lacp_fallback_timeout: 5 - lacp_fallback_individual: true - mlag_domain: ["leafs-1-2"] - lag_interfaces: - - ["leaf1", "Port-Channel1"] - - ["leaf2", "Port-Channel1"] - # MLAG interface 1 on leaf3/leaf4 pair (Port-Channel1 → host2) - - local_identifier: mlag1__leaf3-leaf4 - mlag_id: 1 - description: "MLAG interface 1 for leaf3/leaf4 pair (host2)" - lacp_fallback_timeout: 5 - lacp_fallback_individual: true - mlag_domain: ["leafs-3-4"] - lag_interfaces: - - ["leaf3", "Port-Channel1"] - - ["leaf4", "Port-Channel1"] - # MLAG interface 1 on leaf5/leaf6 pair (Port-Channel1 → host3) - - local_identifier: mlag1__leaf5-leaf6 - mlag_id: 1 - description: "MLAG interface 1 for leaf5/leaf6 pair (host3)" - lacp_fallback_timeout: 5 - lacp_fallback_individual: true - mlag_domain: ["leafs-5-6"] - lag_interfaces: - - ["leaf5", "Port-Channel1"] - - ["leaf6", "Port-Channel1"] - # MLAG interface 1 on leaf7/leaf8 pair (Port-Channel1 → host4) - - local_identifier: mlag1__leaf7-leaf8 - mlag_id: 1 - description: "MLAG interface 1 for leaf7/leaf8 pair (host4)" - lacp_fallback_timeout: 5 - lacp_fallback_individual: true - mlag_domain: ["leafs-7-8"] - lag_interfaces: - - ["leaf7", "Port-Channel1"] - - ["leaf8", "Port-Channel1"] diff --git a/infrahub/objects/13-ipam-links.yml b/infrahub/objects/13-ipam-links.yml deleted file mode 100644 index 77d69f0..0000000 --- a/infrahub/objects/13-ipam-links.yml +++ /dev/null @@ -1,475 +0,0 @@ -# IP Address → Interface linkage -# Depends on: 05-ipam, 08-ipam-vlans (IPs), 04-interfaces, 07-interface-vlans (interfaces) ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraIPAddress - data: - # ============================================================ - # Loopback0 (Router-ID) — /32 - # ============================================================ - - address: "10.0.250.1/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["spine1"] - name: Loopback0 - - address: "10.0.250.2/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["spine2"] - name: Loopback0 - - address: "10.0.250.11/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf1"] - name: Loopback0 - - address: "10.0.250.12/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf2"] - name: Loopback0 - - address: "10.0.250.13/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf3"] - name: Loopback0 - - address: "10.0.250.14/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf4"] - name: Loopback0 - - address: "10.0.250.15/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf5"] - name: Loopback0 - - address: "10.0.250.16/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf6"] - name: Loopback0 - - address: "10.0.250.17/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf7"] - name: Loopback0 - - address: "10.0.250.18/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf8"] - name: Loopback0 - # ============================================================ - # Loopback1 (VTEP) — /32 - # ============================================================ - - address: "10.0.255.11/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf1"] - name: Loopback1 - - address: "10.0.255.11/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf2"] - name: Loopback1 - - address: "10.0.255.12/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf3"] - name: Loopback1 - - address: "10.0.255.12/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf4"] - name: Loopback1 - - address: "10.0.255.13/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf5"] - name: Loopback1 - - address: "10.0.255.13/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf6"] - name: Loopback1 - - address: "10.0.255.14/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf7"] - name: Loopback1 - - address: "10.0.255.14/32" - interface: - kind: InfraInterfaceLoopback - data: - device: ["leaf8"] - name: Loopback1 - # ============================================================ - # Spine1 P2P underlay — /31 - # ============================================================ - - address: "10.0.1.0/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet1 - - address: "10.0.1.2/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet2 - - address: "10.0.1.4/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet3 - - address: "10.0.1.6/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet4 - - address: "10.0.1.8/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet5 - - address: "10.0.1.10/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet6 - - address: "10.0.1.12/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet7 - - address: "10.0.1.14/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine1"] - name: Ethernet8 - # ============================================================ - # Spine2 P2P underlay — /31 - # ============================================================ - - address: "10.0.2.0/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet1 - - address: "10.0.2.2/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet2 - - address: "10.0.2.4/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet3 - - address: "10.0.2.6/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet4 - - address: "10.0.2.8/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet5 - - address: "10.0.2.10/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet6 - - address: "10.0.2.12/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet7 - - address: "10.0.2.14/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["spine2"] - name: Ethernet8 - # ============================================================ - # Leaf P2P underlay (leaf side) — /31 - # ============================================================ - # Leaf1 - - address: "10.0.1.1/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf1"] - name: Ethernet11 - - address: "10.0.2.1/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf1"] - name: Ethernet12 - # Leaf2 - - address: "10.0.1.3/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf2"] - name: Ethernet11 - - address: "10.0.2.3/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf2"] - name: Ethernet12 - # Leaf3 - - address: "10.0.1.5/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf3"] - name: Ethernet11 - - address: "10.0.2.5/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf3"] - name: Ethernet12 - # Leaf4 - - address: "10.0.1.7/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf4"] - name: Ethernet11 - - address: "10.0.2.7/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf4"] - name: Ethernet12 - # Leaf5 - - address: "10.0.1.9/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf5"] - name: Ethernet11 - - address: "10.0.2.9/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf5"] - name: Ethernet12 - # Leaf6 - - address: "10.0.1.11/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf6"] - name: Ethernet11 - - address: "10.0.2.11/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf6"] - name: Ethernet12 - # Leaf7 - - address: "10.0.1.13/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf7"] - name: Ethernet11 - - address: "10.0.2.13/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf7"] - name: Ethernet12 - # Leaf8 - - address: "10.0.1.15/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf8"] - name: Ethernet11 - - address: "10.0.2.15/31" - interface: - kind: InfraInterfaceEthernet - data: - device: ["leaf8"] - name: Ethernet12 - # ============================================================ - # MLAG Peer-Link SVI (Vlan4090) — /31 - # ============================================================ - - address: "10.0.199.254/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf1"] - name: Vlan4090 - - address: "10.0.199.255/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf2"] - name: Vlan4090 - - address: "10.0.199.252/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf3"] - name: Vlan4090 - - address: "10.0.199.253/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf4"] - name: Vlan4090 - - address: "10.0.199.250/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf5"] - name: Vlan4090 - - address: "10.0.199.251/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf6"] - name: Vlan4090 - - address: "10.0.199.248/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf7"] - name: Vlan4090 - - address: "10.0.199.249/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf8"] - name: Vlan4090 - # ============================================================ - # MLAG iBGP Peering SVI (Vlan4091) — /31 - # ============================================================ - - address: "10.0.3.0/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf1"] - name: Vlan4091 - - address: "10.0.3.1/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf2"] - name: Vlan4091 - - address: "10.0.3.2/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf3"] - name: Vlan4091 - - address: "10.0.3.3/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf4"] - name: Vlan4091 - - address: "10.0.3.4/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf5"] - name: Vlan4091 - - address: "10.0.3.5/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf6"] - name: Vlan4091 - - address: "10.0.3.6/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf7"] - name: Vlan4091 - - address: "10.0.3.7/31" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf8"] - name: Vlan4091 - # ============================================================ - # VRF gold SVI addresses — /24 - # ============================================================ - # Vlan34 (leaf3/leaf4) - - address: "10.34.34.2/24" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf3"] - name: Vlan34 - - address: "10.34.34.3/24" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf4"] - name: Vlan34 - # Vlan78 (leaf7/leaf8) - - address: "10.78.78.2/24" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf7"] - name: Vlan78 - - address: "10.78.78.3/24" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf8"] - name: Vlan78 - # Vlan900 — BGP border (leaf7/leaf8) - - address: "10.90.90.2/29" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf7"] - name: Vlan900 - - address: "10.90.90.3/29" - interface: - kind: InfraInterfaceVlan - data: - device: ["leaf8"] - name: Vlan900 diff --git a/infrahub/objects/14-fabric-links.yml b/infrahub/objects/14-fabric-links.yml deleted file mode 100644 index ecec617..0000000 --- a/infrahub/objects/14-fabric-links.yml +++ /dev/null @@ -1,210 +0,0 @@ -# Fabric-to-Device links -# Depends on: 02-devices, 03-fabric ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraDevice - data: - - name: spine1 - role: spine - fabric: "evpn-lab" - - name: spine2 - role: spine - fabric: "evpn-lab" - - name: leaf1 - role: leaf - fabric: "evpn-lab" - - name: leaf2 - role: leaf - fabric: "evpn-lab" - - name: leaf3 - role: leaf - fabric: "evpn-lab" - - name: leaf4 - role: leaf - fabric: "evpn-lab" - - name: leaf5 - role: leaf - fabric: "evpn-lab" - - name: leaf6 - role: leaf - fabric: "evpn-lab" - - name: leaf7 - role: leaf - fabric: "evpn-lab" - - name: leaf8 - role: leaf - fabric: "evpn-lab" ---- -apiVersion: infrahub.app/v1 -kind: Object -spec: - kind: InfraUnderlayLink - data: - # ============================================================ - # Spine1 P2P underlay links (Ethernet1-8 → leaf1-8:Ethernet11) - # ============================================================ - - local_identifier: spine1-eth1__leaf1-eth11 - description: "spine1:Ethernet1 <-> leaf1:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet1"] - local_ip_address: ["10.0.1.0/31"] - remote_device: ["leaf1"] - remote_interface: ["leaf1", "Ethernet11"] - remote_ip_address: ["10.0.1.1/31"] - - local_identifier: spine1-eth2__leaf2-eth11 - description: "spine1:Ethernet2 <-> leaf2:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet2"] - local_ip_address: ["10.0.1.2/31"] - remote_device: ["leaf2"] - remote_interface: ["leaf2", "Ethernet11"] - remote_ip_address: ["10.0.1.3/31"] - - local_identifier: spine1-eth3__leaf3-eth11 - description: "spine1:Ethernet3 <-> leaf3:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet3"] - local_ip_address: ["10.0.1.4/31"] - remote_device: ["leaf3"] - remote_interface: ["leaf3", "Ethernet11"] - remote_ip_address: ["10.0.1.5/31"] - - local_identifier: spine1-eth4__leaf4-eth11 - description: "spine1:Ethernet4 <-> leaf4:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet4"] - local_ip_address: ["10.0.1.6/31"] - remote_device: ["leaf4"] - remote_interface: ["leaf4", "Ethernet11"] - remote_ip_address: ["10.0.1.7/31"] - - local_identifier: spine1-eth5__leaf5-eth11 - description: "spine1:Ethernet5 <-> leaf5:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet5"] - local_ip_address: ["10.0.1.8/31"] - remote_device: ["leaf5"] - remote_interface: ["leaf5", "Ethernet11"] - remote_ip_address: ["10.0.1.9/31"] - - local_identifier: spine1-eth6__leaf6-eth11 - description: "spine1:Ethernet6 <-> leaf6:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet6"] - local_ip_address: ["10.0.1.10/31"] - remote_device: ["leaf6"] - remote_interface: ["leaf6", "Ethernet11"] - remote_ip_address: ["10.0.1.11/31"] - - local_identifier: spine1-eth7__leaf7-eth11 - description: "spine1:Ethernet7 <-> leaf7:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet7"] - local_ip_address: ["10.0.1.12/31"] - remote_device: ["leaf7"] - remote_interface: ["leaf7", "Ethernet11"] - remote_ip_address: ["10.0.1.13/31"] - - local_identifier: spine1-eth8__leaf8-eth11 - description: "spine1:Ethernet8 <-> leaf8:Ethernet11" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine1"] - local_interface: ["spine1", "Ethernet8"] - local_ip_address: ["10.0.1.14/31"] - remote_device: ["leaf8"] - remote_interface: ["leaf8", "Ethernet11"] - remote_ip_address: ["10.0.1.15/31"] - # ============================================================ - # Spine2 P2P underlay links (Ethernet1-8 → leaf1-8:Ethernet12) - # ============================================================ - - local_identifier: spine2-eth1__leaf1-eth12 - description: "spine2:Ethernet1 <-> leaf1:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet1"] - local_ip_address: ["10.0.2.0/31"] - remote_device: ["leaf1"] - remote_interface: ["leaf1", "Ethernet12"] - remote_ip_address: ["10.0.2.1/31"] - - local_identifier: spine2-eth2__leaf2-eth12 - description: "spine2:Ethernet2 <-> leaf2:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet2"] - local_ip_address: ["10.0.2.2/31"] - remote_device: ["leaf2"] - remote_interface: ["leaf2", "Ethernet12"] - remote_ip_address: ["10.0.2.3/31"] - - local_identifier: spine2-eth3__leaf3-eth12 - description: "spine2:Ethernet3 <-> leaf3:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet3"] - local_ip_address: ["10.0.2.4/31"] - remote_device: ["leaf3"] - remote_interface: ["leaf3", "Ethernet12"] - remote_ip_address: ["10.0.2.5/31"] - - local_identifier: spine2-eth4__leaf4-eth12 - description: "spine2:Ethernet4 <-> leaf4:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet4"] - local_ip_address: ["10.0.2.6/31"] - remote_device: ["leaf4"] - remote_interface: ["leaf4", "Ethernet12"] - remote_ip_address: ["10.0.2.7/31"] - - local_identifier: spine2-eth5__leaf5-eth12 - description: "spine2:Ethernet5 <-> leaf5:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet5"] - local_ip_address: ["10.0.2.8/31"] - remote_device: ["leaf5"] - remote_interface: ["leaf5", "Ethernet12"] - remote_ip_address: ["10.0.2.9/31"] - - local_identifier: spine2-eth6__leaf6-eth12 - description: "spine2:Ethernet6 <-> leaf6:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet6"] - local_ip_address: ["10.0.2.10/31"] - remote_device: ["leaf6"] - remote_interface: ["leaf6", "Ethernet12"] - remote_ip_address: ["10.0.2.11/31"] - - local_identifier: spine2-eth7__leaf7-eth12 - description: "spine2:Ethernet7 <-> leaf7:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet7"] - local_ip_address: ["10.0.2.12/31"] - remote_device: ["leaf7"] - remote_interface: ["leaf7", "Ethernet12"] - remote_ip_address: ["10.0.2.13/31"] - - local_identifier: spine2-eth8__leaf8-eth12 - description: "spine2:Ethernet8 <-> leaf8:Ethernet12" - mtu: 9214 - fabric: ["evpn-lab"] - local_device: ["spine2"] - local_interface: ["spine2", "Ethernet8"] - local_ip_address: ["10.0.2.14/31"] - remote_device: ["leaf8"] - remote_interface: ["leaf8", "Ethernet12"] - remote_ip_address: ["10.0.2.15/31"] diff --git a/infrahub/schemas/README.md b/infrahub/schemas/README.md deleted file mode 100644 index ce54fc2..0000000 --- a/infrahub/schemas/README.md +++ /dev/null @@ -1,217 +0,0 @@ -# Infrahub Schema for EVPN-VXLAN Fabric - -This directory contains the Infrahub schema definitions for modeling an EVPN-VXLAN fabric. The schema is designed to represent the [overlaid.net reference topology](https://overlaid.net/2019/01/27/arista-bgp-evpn-configuration-example/) (2 spines, 8 leafs in 4 MLAG pairs). - -## Schema Files - -| File | Nodes | Description | -|------|-------|-------------| -| `base.yml` | Device, InterfaceEthernet, InterfaceLoopback, InterfaceVlan, InterfaceLag, IPAddress, Site, Platform | Core infrastructure and generic Interface | -| `bgp.yml` | AutonomousSystem, BGPRouterConfig, BGPPeerGroup, BGPSession, BGPAddressFamily | BGP routing configuration | -| `vlan_vxlan.yml` | VLAN, VNI, VTEP, VlanVniMapping, EVPNInstance | Layer 2 overlay and VXLAN tunneling | -| `vrf.yml` | VRF, RouteTarget, VRFDeviceAssignment | VRF and L3VNI configuration | -| `mlag.yml` | MlagDomain, MlagPeerConfig, MlagInterface | MLAG domain and peer configuration | -| `extensions.yml` | Fabric, UnderlayLink, HostConnection | Fabric topology and connectivity | - -## Entity Relationship Diagram - -``` - ┌──────────────┐ - │ InfraFabric │ - └──────┬───────┘ - ┌───────────┼───────────┐ - ▼ ▼ ▼ - ┌────────────┐ ┌──────────┐ ┌──────────────────┐ - │LocationSite│ │InfraAS │ │InfraUnderlayLink │ - └────────────┘ └────┬─────┘ │ local/remote: │ - │ │ Device,Interface,│ - │ │ IPAddress │ - ┌────────────┘ └──────────────────┘ - ▼ - ┌──────────────┐ ┌────────────────┐ - │ InfraDevice │◄────────│ InfraPlatform │ - └──────┬───────┘ └────────────────┘ - │ - ┌─────────────┼──────────────┬────────────────┐ - ▼ ▼ ▼ ▼ -┌─────────────┐ ┌──────────┐ ┌───────────┐ ┌──────────────┐ -│InfraInterface│ │InfraBGP- │ │InfraVTEP │ │InfraMlagDomain│ -│ (generic) │ │RouterCfg │ │ │ │ (2 devices) │ -└──────┬──────┘ └────┬─────┘ └─────┬─────┘ └──────┬───────┘ - │ │ │ │ - ▼ ▼ ▼ ▼ - Subtypes: ┌──────────┐ ┌──────────┐ ┌───────────────┐ - - Ethernet │BGPPeer- │ │VlanVni- │ │MlagPeerConfig │ - - Loopback │ Group │ │ Mapping │ │ (per device) │ - - Vlan └──────────┘ └──────────┘ └───────────────┘ - - Lag ┌──────────┐ ┌───────────────┐ - │ │BGPSession│ │MlagInterface │ - ▼ └────┬─────┘ └───────────────┘ -┌──────────────┐ │ -│InfraIPAddress│ │ optional vrf -└──────────────┘ ▼ - ┌─────────┐ ┌──────────────┐ - │InfraVRF │◄────│InfraRoute- │ - └────┬────┘ │ Target │ - │ └──────────────┘ - ▼ - ┌────────────────┐ - │VRFDevice- │ - │ Assignment │ - │ (per device RD)│ - └────────────────┘ - -Layer 2 / EVPN: -┌──────────┐ ┌──────────┐ ┌──────────────┐ -│InfraVLAN │◄──►│ InfraVNI │ │EVPNInstance │ -│ │ │(L2/L3) │ │(per device │ -│ │ └──────────┘ │ RD/RT) │ -└──────────┘ └──────────────┘ -``` - -### Relationship Legend - -| Symbol | Meaning | -|--------|---------| -| `Parent` → child | Child lifecycle depends on parent (e.g., Device → Interface) | -| `Component` → child | Owned collection (e.g., VTEP → VlanVniMapping) | -| `Attribute` | Association without ownership (e.g., BGPSession → VRF) | -| `Generic` | Polymorphic (e.g., IPAddress → any Interface subtype) | - -### All Relationships - -| Source | Relationship | Target | Kind | Cardinality | -|--------|-------------|--------|------|-------------| -| **base.yml** | | | | | -| InfraInterface | `device` | InfraDevice | Parent | one | -| InfraInterface | `ip_addresses` | InfraIPAddress | Generic | many | -| InfraDevice | `site` | LocationSite | Attribute | one (opt) | -| InfraDevice | `platform` | InfraPlatform | Attribute | one (opt) | -| InfraDevice | `asn` | InfraAutonomousSystem | Attribute | one (opt) | -| InfraDevice | `interfaces` | InfraInterface | Component | many | -| InfraDevice | `mlag_domain` | InfraMlagDomain | Attribute | one (opt) | -| InterfaceEthernet | `lag` | InterfaceLag | Attribute | one (opt) | -| InterfaceEthernet | `connected_interface` | InterfaceEthernet | outbound | one (opt) | -| InterfaceVlan | `vlan` | InfraVLAN | Attribute | one (opt) | -| InterfaceLag | `members` | InterfaceEthernet | Component | many | -| InfraIPAddress | `interface` | InfraInterface | Attribute | one (opt) | -| **bgp.yml** | | | | | -| BGPRouterConfig | `device` | InfraDevice | Parent | one | -| BGPRouterConfig | `local_asn` | InfraAutonomousSystem | Attribute | one | -| BGPRouterConfig | `peer_groups` | BGPPeerGroup | Component | many | -| BGPRouterConfig | `sessions` | BGPSession | Component | many | -| BGPPeerGroup | `bgp_config` | BGPRouterConfig | Parent | one | -| BGPPeerGroup | `remote_asn` | InfraAutonomousSystem | Attribute | one (opt) | -| BGPSession | `bgp_config` | BGPRouterConfig | Parent | one | -| BGPSession | `peer_group` | BGPPeerGroup | Attribute | one (opt) | -| BGPSession | `remote_asn` | InfraAutonomousSystem | Attribute | one (opt) | -| BGPSession | `peer_device` | InfraDevice | Attribute | one (opt) | -| BGPSession | `vrf` | InfraVRF | Attribute | one (opt) | -| BGPAddressFamily | `bgp_config` | BGPRouterConfig | Parent | one | -| BGPAddressFamily | `active_peer_groups` | BGPPeerGroup | Attribute | many | -| BGPAddressFamily | `networks` | InfraIPAddress | Attribute | many (opt) | -| **vlan_vxlan.yml** | | | | | -| InfraVLAN | `vni` | InfraVNI | Attribute | one (opt) | -| InfraVLAN | `site` | LocationSite | Attribute | one (opt) | -| InfraVNI | `vlan` | InfraVLAN | Attribute | one (opt) | -| InfraVNI | `vrf` | InfraVRF | Attribute | one (opt) | -| InfraVTEP | `device` | InfraDevice | Parent | one | -| InfraVTEP | `source_interface` | InterfaceLoopback | Attribute | one | -| InfraVTEP | `vlan_vni_mappings` | VlanVniMapping | Component | many | -| VlanVniMapping | `vtep` | InfraVTEP | Parent | one | -| VlanVniMapping | `vlan` | InfraVLAN | Attribute | one | -| VlanVniMapping | `vni` | InfraVNI | Attribute | one | -| EVPNInstance | `device` | InfraDevice | Parent | one | -| EVPNInstance | `vlan` | InfraVLAN | Attribute | one | -| **vrf.yml** | | | | | -| InfraVRF | `l3vni` | InfraVNI | Attribute | one (opt) | -| InfraVRF | `import_targets` | InfraRouteTarget | outbound | many (opt) | -| InfraVRF | `export_targets` | InfraRouteTarget | outbound | many (opt) | -| InfraVRF | `interfaces` | InfraInterface | Attribute | many (opt) | -| VRFDeviceAssignment | `vrf` | InfraVRF | Attribute | one | -| VRFDeviceAssignment | `device` | InfraDevice | Parent | one | -| VRFDeviceAssignment | `import_targets` | InfraRouteTarget | outbound | many (opt) | -| VRFDeviceAssignment | `export_targets` | InfraRouteTarget | outbound | many (opt) | -| **mlag.yml** | | | | | -| MlagDomain | `devices` | InfraDevice | Attribute | many (2) | -| MlagDomain | `peer_vlan` | InfraVLAN | outbound | one | -| MlagDomain | `ibgp_vlan` | InfraVLAN | outbound | one (opt) | -| MlagPeerConfig | `device` | InfraDevice | Parent | one | -| MlagPeerConfig | `mlag_domain` | MlagDomain | Attribute | one | -| MlagPeerConfig | `local_interface` | InterfaceVlan | Attribute | one | -| MlagPeerConfig | `peer_link` | InterfaceLag | Attribute | one | -| MlagInterface | `mlag_domain` | MlagDomain | Attribute | one | -| MlagInterface | `lag_interfaces` | InterfaceLag | Attribute | many (1-2) | -| **extensions.yml** | | | | | -| InfraFabric | `spine_asn` | InfraAutonomousSystem | Attribute | one (opt) | -| InfraFabric | `sites` | LocationSite | Attribute | many (opt) | -| UnderlayLink | `fabric` | InfraFabric | Parent | one | -| UnderlayLink | `local_device` | InfraDevice | outbound | one | -| UnderlayLink | `local_interface` | InterfaceEthernet | outbound | one | -| UnderlayLink | `local_ip_address` | InfraIPAddress | outbound | one | -| UnderlayLink | `remote_device` | InfraDevice | outbound | one | -| UnderlayLink | `remote_interface` | InterfaceEthernet | outbound | one | -| UnderlayLink | `remote_ip_address` | InfraIPAddress | outbound | one | -| HostConnection | `vlans` | InfraVLAN | Attribute | many | -| HostConnection | `mlag_interface` | MlagInterface | Attribute | one (opt) | -| HostConnection | `lag_interface` | InterfaceLag | Attribute | one (opt) | - -## Reference Topology Mapping - -| Physical | Infrahub Model | -|----------|----------------| -| spine1, spine2 | InfraDevice (role: spine) | -| leaf1-8 | InfraDevice (role: leaf) | -| AS 65000 | InfraAutonomousSystem (spines) | -| AS 65001-65004 | InfraAutonomousSystem (leaf pairs) | -| AS 64999 | InfraAutonomousSystem (border router) | -| VLAN 40, 34, 78, 900 | InfraVLAN + InfraVNI | -| VLAN 4090, 4091 | InfraVLAN (vlan_type: mlag_peer/mlag_ibgp, trunk_groups, stp_enabled: false) | -| VRF gold | InfraVRF + VRFDeviceAssignment (per-device RD) | -| Route targets 1:100001 | InfraRouteTarget | -| leaf1+leaf2 pair | InfraMlagDomain | -| Port-Channel999 | InfraInterfaceLag (peer-link) | -| Port-Channel1 | InfraMlagInterface (host-facing) | -| Ethernet1-12 | InfraInterfaceEthernet | -| Loopback0 | InfraInterfaceLoopback (BGP router-id) | -| Loopback1 | InfraInterfaceLoopback (shared VTEP IP per MLAG pair) | -| Vxlan1 | InfraVTEP | -| Vlan34/78 SVIs | InfraInterfaceVlan (virtual_router_address for anycast gateway) | -| peer groups (underlay, evpn, underlay_ibgp) | InfraBGPPeerGroup | -| BGP sessions (global) | InfraBGPSession (vrf: null) | -| BGP sessions in VRF gold (leaf7/8 → AS 64999) | InfraBGPSession (vrf: gold) | -| spine1/2 p2p links | InfraUnderlayLink (IPAddress relations, not attributes) | -| distance bgp 20 200 200 | BGPRouterConfig (ebgp_distance, ibgp_distance, local_distance) | - -## Usage - -### Loading the Schema - -```bash -infrahubctl schema load schemas/ -``` - -### Validation - -```bash -infrahubctl schema check schemas/ -``` - -## Key Design Decisions - -1. **Generic Interface**: All interface types inherit from `InfraInterface` generic for polymorphic queries -2. **MLAG as Domain**: MLAG is modeled as a domain containing exactly 2 devices, with per-device config via MlagPeerConfig -3. **BGP Hierarchy**: BGPRouterConfig → PeerGroups → Sessions allows template-based configuration -4. **BGP VRF Sessions**: BGPSession has an optional `vrf` relation (kind: Attribute) to support peering inside a VRF context (#50) -5. **VTEP as single model**: VTEP is the unique VXLAN model (InterfaceVxlan was removed to avoid duplication — #44) -6. **EVPN Instance per VLAN**: Allows device-specific RD/RT while referencing common VLAN/VNI -7. **Per-device scoped IDs**: BGPPeerGroup and BGPSession use `bgp_config__router_id__value` prefix in human_friendly_id for global uniqueness (#43) -8. **UnderlayLink IPs as relations**: local/remote IPs reference InfraIPAddress objects instead of inline attributes to avoid dual source of truth (#47) -9. **VRFDeviceAssignment**: Separates VRF definition (global) from per-device assignment (with device-specific RD/RT overrides) -10. **Anycast gateway**: InterfaceVlan has `virtual_router_address` for `ip virtual-router address` and `autostate` for MLAG SVIs (#46) - -## Related Issues - -- Parent issue: [#41 — Define Infrahub Schema for EVPN-VXLAN Fabric](https://gitea.arnodo.fr/Damien/fabric-orchestrator/issues/41) -- Schema fixes: #43 (unique IDs), #44 (remove duplicate VTEP), #45 (VLAN unique), #46 (anycast gateway), #47 (underlay IPs), #48 (BGP distance), #49 (trunk groups), #50 (VRF BGP sessions) -- Depends on: Schema being loaded before transforms (#30, #31, #32, #33) diff --git a/infrahub/schemas/base.yml b/infrahub/schemas/base.yml deleted file mode 100644 index 8b13f74..0000000 --- a/infrahub/schemas/base.yml +++ /dev/null @@ -1,365 +0,0 @@ -# Base Infrastructure Schema for EVPN-VXLAN Fabric -# This schema defines core infrastructure objects required for fabric orchestration ---- -version: "1.0" -generics: - - name: Interface - namespace: Infra - description: Generic interface - parent for all interface types - label: Interface - include_in_menu: false - hierarchical: false - display_label: "{{ name__value }}" - attributes: - - name: name - kind: Text - description: Interface name (e.g., Ethernet1, Loopback0) - - name: description - kind: Text - optional: true - - name: enabled - kind: Boolean - default_value: true - - name: mtu - kind: Number - optional: true - description: Maximum Transmission Unit - relationships: - - name: device - peer: InfraDevice - cardinality: one - kind: Parent - optional: false - - name: ip_addresses - peer: InfraIPAddress - identifier: interface__ip_addresses - cardinality: many - kind: Generic - -nodes: - # ================================================================ - # Location - # ================================================================ - - name: Site - namespace: Location - description: Physical site or data center - label: Site - icon: mingcute--building-4-line - include_in_menu: false - human_friendly_id: - - name__value - order_by: - - name__value - display_label: "{{ name__value }}" - attributes: - - name: name - kind: Text - unique: true - - name: description - kind: Text - optional: true - - name: facility - kind: Text - optional: true - description: Facility identifier or code - relationships: - - name: devices - peer: InfraDevice - identifier: device__site - cardinality: many - kind: Generic - description: Devices at this site - - name: fabrics - peer: InfraFabric - identifier: fabric__sites - cardinality: many - kind: Generic - description: Fabrics deployed at this site - - # ================================================================ - # Platform - # ================================================================ - - name: Platform - namespace: Infra - description: Device platform/OS (e.g., Arista EOS, Cisco NX-OS) - label: Platform - icon: mdi--chip - include_in_menu: false - human_friendly_id: - - name__value - order_by: - - name__value - display_label: "{{ name__value }}" - attributes: - - name: name - kind: Text - unique: true - description: Platform name (e.g., arista_eos, cisco_nxos) - - name: description - kind: Text - optional: true - - name: napalm_driver - kind: Text - optional: true - description: NAPALM driver name - - name: netmiko_device_type - kind: Text - optional: true - description: Netmiko device type - - # ================================================================ - # Device - # ================================================================ - - name: Device - namespace: Infra - description: Network device (spine, leaf, etc.) - label: Device - icon: mdi--server-network - include_in_menu: false - human_friendly_id: - - name__value - order_by: - - name__value - display_label: "{{ name__value }}" - attributes: - - name: name - kind: Text - unique: true - description: Device hostname - - name: description - kind: Text - optional: true - - name: role - kind: Dropdown - choices: - - name: spine - label: Spine - color: "#3b82f6" - - name: leaf - label: Leaf - color: "#22c55e" - description: Fabric role - - name: status - kind: Dropdown - default_value: active - choices: - - name: active - label: Active - color: "#22c55e" - - name: planned - label: Planned - color: "#3b82f6" - - name: maintenance - label: Maintenance - color: "#f59e0b" - - name: decommissioned - label: Decommissioned - color: "#ef4444" - relationships: - - name: site - peer: LocationSite - identifier: device__site - cardinality: one - optional: true - - name: platform - peer: InfraPlatform - cardinality: one - optional: true - - name: asn - peer: InfraAutonomousSystem - cardinality: one - optional: true - description: BGP Autonomous System - - name: interfaces - peer: InfraInterface - cardinality: many - kind: Component - - name: mlag_domain - peer: InfraMlagDomain - cardinality: one - optional: true - - name: fabric - peer: InfraFabric - identifier: fabric__devices - cardinality: one - optional: true - description: Fabric this device belongs to - - # ================================================================ - # Interface Types (inherit from InfraInterface generic) - # ================================================================ - - name: InterfaceEthernet - namespace: Infra - description: Physical Ethernet interface - label: Ethernet Interface - icon: mdi--ethernet - include_in_menu: false - inherit_from: - - InfraInterface - uniqueness_constraints: - - ["device", "name__value"] - human_friendly_id: - - device__name__value - - name__value - display_label: "{{ name__value }}" - attributes: - - name: speed - kind: Dropdown - optional: true - choices: - - name: "1000" - label: 1 Gbps - - name: "10000" - label: 10 Gbps - - name: "25000" - label: 25 Gbps - - name: "40000" - label: 40 Gbps - - name: "100000" - label: 100 Gbps - - name: mode - kind: Dropdown - optional: true - choices: - - name: access - label: Access - - name: trunk - label: Trunk - - name: routed - label: Routed (L3) - description: Switchport mode - relationships: - - name: lag - peer: InfraInterfaceLag - cardinality: one - optional: true - description: Parent LAG interface - - name: connected_interface - peer: InfraInterfaceEthernet - identifier: ethernet_connected_to - direction: outbound - cardinality: one - optional: true - description: Connected peer interface - - - name: InterfaceLoopback - namespace: Infra - description: Loopback interface - label: Loopback Interface - icon: mdi--reload - include_in_menu: false - inherit_from: - - InfraInterface - uniqueness_constraints: - - ["device", "name__value"] - human_friendly_id: - - device__name__value - - name__value - display_label: "{{ name__value }}" - - - name: InterfaceVlan - namespace: Infra - description: VLAN SVI interface - label: VLAN Interface - icon: mdi--lan - include_in_menu: false - inherit_from: - - InfraInterface - uniqueness_constraints: - - ["device", "name__value"] - human_friendly_id: - - device__name__value - - name__value - display_label: "{{ name__value }}" - attributes: - - name: virtual_router_address - kind: IPHost - optional: true - description: Anycast gateway IP (ip virtual-router address) - - name: autostate - kind: Boolean - default_value: true - description: "Enable autostate (set false for MLAG peer SVIs)" - relationships: - - name: vlan - peer: InfraVLAN - identifier: vlan__svi - cardinality: one - optional: true - - - name: InterfaceLag - namespace: Infra - description: Link Aggregation (Port-Channel) interface - label: LAG Interface - icon: mdi--link-variant - include_in_menu: false - inherit_from: - - InfraInterface - uniqueness_constraints: - - ["device", "name__value"] - human_friendly_id: - - device__name__value - - name__value - display_label: "{{ name__value }}" - attributes: - - name: lacp_mode - kind: Dropdown - optional: true - choices: - - name: active - label: Active - - name: passive - label: Passive - - name: static - label: Static (No LACP) - - name: mlag_id - kind: Number - optional: true - description: MLAG interface ID - relationships: - - name: members - peer: InfraInterfaceEthernet - cardinality: many - kind: Component - - # ================================================================ - # IP Address - # ================================================================ - - name: IPAddress - namespace: Infra - description: IP Address assignment - label: IP Address - icon: mdi--ip-network - include_in_menu: false - human_friendly_id: - - address__value - order_by: - - address__value - display_label: "{{ address__value }}" - attributes: - - name: address - kind: IPHost - description: IP address with prefix (e.g., 10.0.1.1/31) - - name: description - kind: Text - optional: true - - name: status - kind: Dropdown - default_value: active - choices: - - name: active - label: Active - color: "#22c55e" - - name: reserved - label: Reserved - color: "#3b82f6" - - name: deprecated - label: Deprecated - color: "#ef4444" - relationships: - - name: interface - peer: InfraInterface - identifier: interface__ip_addresses - cardinality: one - optional: true - kind: Attribute diff --git a/infrahub/schemas/bgp.yml b/infrahub/schemas/bgp.yml deleted file mode 100644 index a8653d2..0000000 --- a/infrahub/schemas/bgp.yml +++ /dev/null @@ -1,297 +0,0 @@ -# BGP Schema for EVPN-VXLAN Fabric -# Defines Autonomous System, Peer Groups, and BGP Sessions ---- -version: "1.0" -nodes: - # ================================================================ - # Autonomous System - # ================================================================ - - name: AutonomousSystem - namespace: Infra - description: BGP Autonomous System - label: Autonomous System - icon: mdi--cloud-outline - include_in_menu: false - human_friendly_id: - - asn__value - order_by: - - asn__value - display_label: "{{ asn__value }}" - attributes: - - name: asn - kind: Number - unique: true - description: AS Number (e.g., 65000) - - name: description - kind: Text - optional: true - - name: as_type - kind: Dropdown - default_value: private - choices: - - name: private - label: Private - - name: public - label: Public - - # ================================================================ - # BGP Router Configuration (per device) - # ================================================================ - - name: BGPRouterConfig - namespace: Infra - description: BGP router configuration on a device - label: BGP Router Config - icon: mdi--router-wireless - include_in_menu: false - human_friendly_id: - - device__name__value - display_label: "{{ router_id__value }}" - attributes: - - name: router_id - kind: IPHost - unique: true - description: BGP Router ID - - name: default_ipv4_unicast - kind: Boolean - default_value: false - description: Enable default IPv4 unicast - - name: log_neighbor_changes - kind: Boolean - default_value: true - - name: ecmp_max_paths - kind: Number - default_value: 4 - description: Maximum ECMP paths - - name: ecmp_max_ecmp - kind: Number - default_value: 64 - description: Maximum ECMP routes - - name: ebgp_distance - kind: Number - default_value: 20 - description: eBGP administrative distance - - name: ibgp_distance - kind: Number - default_value: 200 - description: iBGP administrative distance - - name: local_distance - kind: Number - default_value: 200 - description: Local route administrative distance - relationships: - - name: device - peer: InfraDevice - cardinality: one - kind: Parent - optional: false - - name: local_asn - peer: InfraAutonomousSystem - cardinality: one - - name: peer_groups - peer: InfraBGPPeerGroup - cardinality: many - kind: Component - - name: sessions - peer: InfraBGPSession - cardinality: many - kind: Component - - # ================================================================ - # BGP Peer Group - # ================================================================ - - name: BGPPeerGroup - namespace: Infra - description: BGP peer group template - label: BGP Peer Group - icon: mdi--account-group - include_in_menu: false - uniqueness_constraints: - - ["local_identifier__value"] - human_friendly_id: - - local_identifier__value - display_label: "{{ name__value }}" - attributes: - - name: local_identifier - kind: Text - description: "Unique identifier combining device name and peer group name (e.g. spine1__evpn)" - - name: name - kind: Text - description: Peer group name (e.g., underlay, evpn) - - name: description - kind: Text - optional: true - - name: update_source - kind: Text - optional: true - description: Update source interface (e.g., Loopback0) - - name: ebgp_multihop - kind: Number - optional: true - description: eBGP multihop TTL - - name: send_community - kind: Dropdown - default_value: none - choices: - - name: none - label: None - - name: standard - label: Standard - - name: extended - label: Extended - - name: both - label: Both - - name: next_hop_self - kind: Boolean - default_value: false - - name: next_hop_unchanged - kind: Boolean - default_value: false - description: Keep next-hop unchanged (for route reflector) - - name: maximum_routes - kind: Number - optional: true - - name: maximum_routes_warning_only - kind: Boolean - default_value: true - - name: peer_group_type - kind: Dropdown - default_value: underlay - choices: - - name: underlay - label: Underlay IPv4 - - name: underlay_ibgp - label: Underlay iBGP - - name: evpn - label: EVPN Overlay - relationships: - - name: bgp_config - peer: InfraBGPRouterConfig - cardinality: one - kind: Parent - optional: false - - name: remote_asn - peer: InfraAutonomousSystem - cardinality: one - optional: true - - # ================================================================ - # BGP Session (Neighbor) - # ================================================================ - - name: BGPSession - namespace: Infra - description: BGP neighbor session - label: BGP Session - icon: mdi--connection - include_in_menu: false - uniqueness_constraints: - - ["local_identifier__value"] - human_friendly_id: - - local_identifier__value - display_label: "{{ peer_address__value }}" - attributes: - - name: local_identifier - kind: Text - description: "Unique identifier combining device name and peer address (e.g. spine1__10.0.250.11)" - - name: peer_address - kind: IPHost - description: Neighbor IP address - - name: description - kind: Text - optional: true - - name: enabled - kind: Boolean - default_value: true - relationships: - - name: bgp_config - peer: InfraBGPRouterConfig - cardinality: one - kind: Parent - optional: false - - name: peer_group - peer: InfraBGPPeerGroup - cardinality: one - optional: true - - name: remote_asn - peer: InfraAutonomousSystem - cardinality: one - optional: true - description: Override peer group remote-as - - name: peer_device - peer: InfraDevice - cardinality: one - optional: true - description: Remote peer device (for documentation) - - name: vrf - peer: InfraVRF - cardinality: one - kind: Attribute - optional: true - description: VRF context for this session (null = global BGP process) - - # ================================================================ - # BGP Address Family Configuration - # ================================================================ - - name: BGPAddressFamily - namespace: Infra - description: BGP address family configuration - label: BGP Address Family - icon: mdi--format-list-bulleted - include_in_menu: false - human_friendly_id: - - local_identifier__value - display_label: "{{ afi__value }}" - attributes: - - name: local_identifier - kind: Text - description: "Unique identifier combining device name and AFI/SAFI (e.g. spine1__ipv4_unicast)" - - name: afi - kind: Dropdown - choices: - - name: ipv4 - label: IPv4 - - name: ipv6 - label: IPv6 - - name: evpn - label: EVPN - description: Address Family Identifier - - name: safi - kind: Dropdown - default_value: unicast - choices: - - name: unicast - label: Unicast - - name: multicast - label: Multicast - description: Sub Address Family Identifier - relationships: - - name: device - peer: InfraDevice - cardinality: one - kind: Attribute - optional: false - description: Device this address family belongs to (denormalized for query filtering) - - name: bgp_config - peer: InfraBGPRouterConfig - cardinality: one - kind: Parent - optional: false - - name: active_peer_groups - peer: InfraBGPPeerGroup - cardinality: many - description: Peer groups activated in this AF - - name: active_sessions - peer: InfraBGPSession - cardinality: many - optional: true - description: Individual sessions activated in this AF (e.g. spine direct neighbors) - - name: vrf - peer: InfraVRF - cardinality: one - kind: Attribute - optional: true - description: VRF context for this AF (null = global BGP process) - - name: networks - peer: InfraIPAddress - cardinality: many - optional: true - description: Networks to advertise diff --git a/infrahub/schemas/extensions.yml b/infrahub/schemas/extensions.yml deleted file mode 100644 index ebe647d..0000000 --- a/infrahub/schemas/extensions.yml +++ /dev/null @@ -1,178 +0,0 @@ -# Extensions Schema for EVPN-VXLAN Fabric -# Custom attributes and fabric-specific configurations ---- -version: "1.0" -nodes: - # ================================================================ - # Fabric (Top-level container for all fabric objects) - # ================================================================ - - name: Fabric - namespace: Infra - description: EVPN-VXLAN Fabric definition - label: Fabric - icon: mdi--vector-polygon - include_in_menu: false - human_friendly_id: - - name__value - order_by: - - name__value - display_label: "{{ name__value }}" - attributes: - - name: name - kind: Text - unique: true - description: Fabric name (e.g., arista-evpn-fabric) - - name: description - kind: Text - optional: true - - name: underlay_protocol - kind: Dropdown - default_value: ebgp - choices: - - name: ebgp - label: eBGP - - name: ospf - label: OSPF - - name: isis - label: IS-IS - - name: overlay_protocol - kind: Dropdown - default_value: evpn - choices: - - name: evpn - label: EVPN - - name: ingress_replication - label: Ingress Replication - - name: anycast_gateway_mac - kind: Text - optional: true - description: "Shared MAC for anycast gateway (format: xxxx.xxxx.xxxx)" - relationships: - - name: spine_asn - peer: InfraAutonomousSystem - cardinality: one - optional: true - description: AS used by spine layer - - name: sites - peer: LocationSite - identifier: fabric__sites - cardinality: many - optional: true - - name: devices - peer: InfraDevice - identifier: fabric__devices - cardinality: many - kind: Generic - description: Devices in this fabric - - # ================================================================ - # Underlay P2P Link - # ================================================================ - - name: UnderlayLink - namespace: Infra - description: Point-to-point underlay link between devices - label: Underlay Link - icon: mdi--cable-data - include_in_menu: false - uniqueness_constraints: - - ["local_identifier__value"] - human_friendly_id: - - local_identifier__value - display_label: "{{ description__value }}" - attributes: - - name: local_identifier - kind: Text - description: "Unique identifier combining local and remote device/interface (e.g. spine1-eth1__leaf1-eth11)" - - name: description - kind: Text - description: Link description (e.g., spine1:eth1 <-> leaf1:eth11) - - name: mtu - kind: Number - default_value: 9214 - relationships: - - name: fabric - peer: InfraFabric - cardinality: one - kind: Parent - optional: false - - name: local_device - peer: InfraDevice - identifier: underlay_link_local_device - cardinality: one - direction: outbound - - name: local_interface - peer: InfraInterfaceEthernet - identifier: underlay_link_local_interface - cardinality: one - direction: outbound - - name: local_ip_address - peer: InfraIPAddress - identifier: underlay_link_local_ip - cardinality: one - direction: outbound - - name: remote_device - peer: InfraDevice - identifier: underlay_link_remote_device - cardinality: one - direction: outbound - - name: remote_interface - peer: InfraInterfaceEthernet - identifier: underlay_link_remote_interface - cardinality: one - direction: outbound - - name: remote_ip_address - peer: InfraIPAddress - identifier: underlay_link_remote_ip - cardinality: one - direction: outbound - - # ================================================================ - # Host Connection - # ================================================================ - - name: HostConnection - namespace: Infra - description: Host connection to fabric (single or dual-homed) - label: Host Connection - icon: mdi--desktop-tower - include_in_menu: false - human_friendly_id: - - hostname__value - display_label: "{{ hostname__value }}" - attributes: - - name: hostname - kind: Text - description: Connected host name - - name: description - kind: Text - optional: true - - name: connection_type - kind: Dropdown - default_value: dual_homed - choices: - - name: single_homed - label: Single-Homed - - name: dual_homed - label: Dual-Homed (MLAG) - - name: lacp_mode - kind: Dropdown - default_value: active - choices: - - name: active - label: Active - - name: passive - label: Passive - relationships: - - name: vlans - peer: InfraVLAN - cardinality: many - description: VLANs allowed on this connection - - name: mlag_interface - peer: InfraMlagInterface - cardinality: one - optional: true - description: MLAG interface for dual-homed - - name: lag_interface - peer: InfraInterfaceLag - cardinality: one - optional: true - description: LAG for single-homed diff --git a/infrahub/schemas/mlag.yml b/infrahub/schemas/mlag.yml deleted file mode 100644 index a245115..0000000 --- a/infrahub/schemas/mlag.yml +++ /dev/null @@ -1,148 +0,0 @@ -# MLAG Schema for EVPN-VXLAN Fabric -# Defines MLAG domain and peer configuration ---- -version: "1.0" -nodes: - # ================================================================ - # MLAG Domain - # ================================================================ - - name: MlagDomain - namespace: Infra - description: MLAG domain configuration for leaf pair - label: MLAG Domain - icon: mdi--link-variant - include_in_menu: false - human_friendly_id: - - domain_id__value - display_label: "{{ domain_id__value }}" - attributes: - - name: domain_id - kind: Text - description: MLAG domain identifier (e.g., leafs) - - name: description - kind: Text - optional: true - - name: virtual_mac - kind: Text - description: "Shared virtual MAC (format: xxxx.xxxx.xxxx)" - - name: heartbeat_vrf - kind: Text - default_value: mgmt - description: VRF for heartbeat (typically mgmt) - - name: dual_primary_detection - kind: Boolean - default_value: true - - name: dual_primary_delay - kind: Number - default_value: 10 - description: Delay in seconds before dual-primary action - - name: dual_primary_action - kind: Dropdown - default_value: errdisable - choices: - - name: errdisable - label: Error Disable Interfaces - - name: none - label: No Action - relationships: - - name: devices - peer: InfraDevice - cardinality: many - min_count: 2 - max_count: 2 - description: MLAG peer devices - - name: peer_vlan - peer: InfraVLAN - identifier: mlag_domain_peer_vlan - cardinality: one - direction: outbound - description: VLAN for MLAG peer-link control traffic - - name: ibgp_vlan - peer: InfraVLAN - identifier: mlag_domain_ibgp_vlan - cardinality: one - direction: outbound - optional: true - description: VLAN for iBGP peering between MLAG peers - - # ================================================================ - # MLAG Peer Configuration (per device) - # ================================================================ - - name: MlagPeerConfig - namespace: Infra - description: MLAG configuration on a specific device - label: MLAG Peer Config - icon: mdi--server-network - include_in_menu: false - human_friendly_id: - - device__name__value - display_label: "{{ local_interface_ip__value }}" - attributes: - - name: local_interface_ip - kind: IPHost - description: IP on MLAG peer VLAN SVI - - name: peer_address - kind: IPHost - description: Peer's MLAG SVI IP address - - name: heartbeat_peer_ip - kind: IPHost - description: Peer's management IP for heartbeat - relationships: - - name: device - peer: InfraDevice - cardinality: one - kind: Parent - optional: false - - name: mlag_domain - peer: InfraMlagDomain - cardinality: one - - name: local_interface - peer: InfraInterfaceVlan - cardinality: one - description: Local MLAG SVI - - name: peer_link - peer: InfraInterfaceLag - cardinality: one - description: Peer-link port-channel - - # ================================================================ - # MLAG Interface (MLAG-enabled LAG) - # ================================================================ - - name: MlagInterface - namespace: Infra - description: MLAG interface configuration - label: MLAG Interface - icon: mdi--ethernet-cable - include_in_menu: false - uniqueness_constraints: - - ["local_identifier__value"] - human_friendly_id: - - local_identifier__value - display_label: "{{ mlag_id__value }}" - attributes: - - name: local_identifier - kind: Text - description: "Unique identifier combining mlag_id and peer devices (e.g. mlag1__leaf1-leaf2)" - - name: mlag_id - kind: Number - description: MLAG interface ID - - name: description - kind: Text - optional: true - - name: lacp_fallback_timeout - kind: Number - default_value: 5 - description: LACP fallback timeout in seconds - - name: lacp_fallback_individual - kind: Boolean - default_value: true - relationships: - - name: mlag_domain - peer: InfraMlagDomain - cardinality: one - - name: lag_interfaces - peer: InfraInterfaceLag - cardinality: many - min_count: 1 - max_count: 2 - description: LAG interfaces on each MLAG peer diff --git a/infrahub/schemas/vlan_vxlan.yml b/infrahub/schemas/vlan_vxlan.yml deleted file mode 100644 index 33cc0aa..0000000 --- a/infrahub/schemas/vlan_vxlan.yml +++ /dev/null @@ -1,241 +0,0 @@ -# VLAN and VXLAN Schema for EVPN-VXLAN Fabric -# Defines VLAN, VNI mappings, and VTEP configuration ---- -version: "1.0" -nodes: - # ================================================================ - # VLAN - # ================================================================ - - name: VLAN - namespace: Infra - description: Virtual LAN configuration - label: VLAN - icon: mdi--lan-connect - include_in_menu: false - human_friendly_id: - - vlan_id__value - order_by: - - vlan_id__value - display_label: "{{ vlan_id__value }} ({{ name__value }})" - attributes: - - name: vlan_id - kind: Number - unique: true - description: VLAN ID (1-4094) - - name: name - kind: Text - description: VLAN name - - name: description - kind: Text - optional: true - - name: status - kind: Dropdown - default_value: active - choices: - - name: active - label: Active - color: "#22c55e" - - name: reserved - label: Reserved - color: "#3b82f6" - - name: deprecated - label: Deprecated - color: "#ef4444" - - name: vlan_type - kind: Dropdown - default_value: standard - choices: - - name: standard - label: Standard - - name: mlag_peer - label: MLAG Peer - - name: mlag_ibgp - label: MLAG iBGP - description: VLAN purpose - - name: trunk_groups - kind: List - optional: true - description: "Trunk groups restricting VLAN propagation (e.g., mlag-peer)" - - name: stp_enabled - kind: Boolean - default_value: true - description: "Enable spanning-tree on this VLAN (set false for MLAG peer VLANs)" - relationships: - - name: vni - peer: InfraVNI - cardinality: one - optional: true - description: Associated L2VNI for VXLAN - - name: site - peer: LocationSite - cardinality: one - optional: true - - name: svi_interfaces - peer: InfraInterfaceVlan - identifier: vlan__svi - cardinality: many - kind: Generic - description: SVI interfaces for this VLAN - - # ================================================================ - # VNI (VXLAN Network Identifier) - # ================================================================ - - name: VNI - namespace: Infra - description: VXLAN Network Identifier - label: VNI - icon: mdi--tunnel-outline - include_in_menu: false - human_friendly_id: - - vni__value - order_by: - - vni__value - display_label: "{{ vni__value }}" - attributes: - - name: vni - kind: Number - unique: true - description: VNI value (1-16777215) - - name: description - kind: Text - optional: true - - name: vni_type - kind: Dropdown - default_value: l2vni - choices: - - name: l2vni - label: L2 VNI - color: "#3b82f6" - - name: l3vni - label: L3 VNI - color: "#22c55e" - description: VNI type for EVPN - relationships: - - name: vlan - peer: InfraVLAN - cardinality: one - optional: true - description: Associated VLAN for L2VNI - - name: vrf - peer: InfraVRF - cardinality: one - optional: true - description: Associated VRF for L3VNI - - # ================================================================ - # VTEP (VXLAN Tunnel Endpoint) - # ================================================================ - - name: VTEP - namespace: Infra - description: VXLAN Tunnel Endpoint configuration - label: VTEP - icon: mdi--server-network-outline - include_in_menu: false - human_friendly_id: - - device__name__value - display_label: "{{ source_address__value }}" - attributes: - - name: source_address - kind: IPHost - description: VTEP source IP (typically from Loopback1) - - name: udp_port - kind: Number - default_value: 4789 - - name: learn_restrict - kind: Dropdown - default_value: any - choices: - - name: any - label: Any - - name: flood - label: Flood - description: MAC learning restriction mode - relationships: - - name: device - peer: InfraDevice - cardinality: one - kind: Parent - optional: false - - name: source_interface - peer: InfraInterfaceLoopback - cardinality: one - description: Source interface for VTEP - - name: vlan_vni_mappings - peer: InfraVlanVniMapping - cardinality: many - kind: Component - - # ================================================================ - # VLAN to VNI Mapping (per-device) - # ================================================================ - - name: VlanVniMapping - namespace: Infra - description: VLAN to VNI mapping on a VTEP - label: VLAN-VNI Mapping - icon: mdi--swap-horizontal - include_in_menu: false - uniqueness_constraints: - - ["local_identifier__value"] - human_friendly_id: - - local_identifier__value - display_label: "{{ description__value }}" - attributes: - - name: local_identifier - kind: Text - description: "Unique identifier combining device name, VLAN ID and VNI (e.g. leaf1__vlan40__vni110040)" - - name: description - kind: Text - optional: true - description: "Mapping description (e.g., VLAN 40 <-> VNI 10040)" - relationships: - - name: vtep - peer: InfraVTEP - cardinality: one - kind: Parent - optional: false - - name: vlan - peer: InfraVLAN - cardinality: one - - name: vni - peer: InfraVNI - cardinality: one - - # ================================================================ - # EVPN Instance (per VLAN) - # ================================================================ - - name: EVPNInstance - namespace: Infra - description: EVPN instance configuration (route targets for L2 extension) - label: EVPN Instance - icon: mdi--cloud-sync - include_in_menu: false - uniqueness_constraints: - - ["local_identifier__value"] - human_friendly_id: - - local_identifier__value - display_label: "{{ route_distinguisher__value }}" - attributes: - - name: local_identifier - kind: Text - description: "Unique identifier combining device name and VLAN ID (e.g. leaf1__vlan40)" - - name: route_distinguisher - kind: Text - description: "Route Distinguisher (format: ASN:VNI or IP:VNI)" - - name: route_target_import - kind: Text - description: "Import Route Target (format: VNI:VNI)" - - name: route_target_export - kind: Text - description: "Export Route Target (format: VNI:VNI)" - - name: redistribute_learned - kind: Boolean - default_value: true - relationships: - - name: vlan - peer: InfraVLAN - cardinality: one - - name: device - peer: InfraDevice - cardinality: one - kind: Parent - optional: false diff --git a/infrahub/schemas/vrf.yml b/infrahub/schemas/vrf.yml deleted file mode 100644 index 68e1569..0000000 --- a/infrahub/schemas/vrf.yml +++ /dev/null @@ -1,124 +0,0 @@ -# VRF Schema for EVPN-VXLAN Fabric -# Defines VRF and Route Target configuration for L3 VPN ---- -version: "1.0" -nodes: - # ================================================================ - # VRF (Virtual Routing and Forwarding) - # ================================================================ - - name: VRF - namespace: Infra - description: Virtual Routing and Forwarding instance - label: VRF - icon: mdi--router - include_in_menu: false - human_friendly_id: - - name__value - order_by: - - name__value - display_label: "{{ name__value }}" - attributes: - - name: name - kind: Text - unique: true - description: VRF name - - name: description - kind: Text - optional: true - - name: route_distinguisher - kind: Text - optional: true - description: "Route Distinguisher (format: ASN:NN or IP:NN)" - - name: vrf_id - kind: Number - optional: true - description: VRF table ID - relationships: - - name: l3vni - peer: InfraVNI - cardinality: one - optional: true - description: L3 VNI for symmetric IRB - - name: import_targets - peer: InfraRouteTarget - identifier: vrf_import_targets - cardinality: many - direction: outbound - optional: true - - name: export_targets - peer: InfraRouteTarget - identifier: vrf_export_targets - cardinality: many - direction: outbound - optional: true - - name: interfaces - peer: InfraInterface - cardinality: many - optional: true - description: Interfaces assigned to this VRF - - # ================================================================ - # Route Target - # ================================================================ - - name: RouteTarget - namespace: Infra - description: BGP Route Target for VPN import/export - label: Route Target - icon: mdi--target - include_in_menu: false - human_friendly_id: - - target__value - order_by: - - target__value - display_label: "{{ target__value }}" - attributes: - - name: target - kind: Text - unique: true - description: "Route Target value (format: ASN:NN or IP:NN)" - - name: description - kind: Text - optional: true - - # ================================================================ - # VRF Device Assignment - # ================================================================ - - name: VRFDeviceAssignment - namespace: Infra - description: VRF assignment to a specific device - label: VRF Assignment - icon: mdi--router-network - include_in_menu: false - human_friendly_id: - - device__name__value - - vrf__name__value - display_label: "{{ device__name__value }} - {{ vrf__name__value }}" - attributes: - - name: route_distinguisher - kind: Text - optional: true - description: "Device-specific RD (overrides VRF default)" - relationships: - - name: vrf - peer: InfraVRF - cardinality: one - optional: false - - name: device - peer: InfraDevice - cardinality: one - kind: Parent - optional: false - - name: import_targets - peer: InfraRouteTarget - identifier: vrf_assignment_import_targets - cardinality: many - direction: outbound - optional: true - description: Device-specific import RTs - - name: export_targets - peer: InfraRouteTarget - identifier: vrf_assignment_export_targets - cardinality: many - direction: outbound - optional: true - description: Device-specific export RTs diff --git a/infrahub/transforms/README.md b/infrahub/transforms/README.md deleted file mode 100644 index 3c6ea2e..0000000 --- a/infrahub/transforms/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Infrahub Transforms - -Jinja2 transforms that query InfraHub and produce JSON configuration payloads for the EVPN-VXLAN fabric devices. - -Each transform follows the same pattern: a **GraphQL query** fetches intent data from InfraHub, and a **Jinja2 template** renders it into a structured JSON payload. Transforms are registered in `.infrahub.yml` at the repository root. - -## Available Transforms - -| Transform | Query | Scope | -|-----------|-------|-------| -| `vlan_yang_transform` | `vlan_intent` | VLAN definitions per device | -| `interface_yang_transform` | `interface_intent` | Physical/logical interfaces, switchport config | -| `vxlan_yang_transform` | `vxlan_intent` | VXLAN/VTEP tunnel config, VNI mappings | -| `vrf_yang_transform` | `vrf_intent` | VRF instances, L3VNI, route targets | -| `mlag_yang_transform` | `mlag_intent` | MLAG domain, peer-link, dual-primary detection | -| `bgp_yang_transform` | `bgp_intent` | BGP process, peer groups, neighbors, address families | - -## Usage - -All transforms take a `device_name` parameter: - -```bash -# Render a single transform -infrahubctl render vlan_yang_transform device_name=leaf1 -infrahubctl render interface_yang_transform device_name=leaf1 -infrahubctl render vxlan_yang_transform device_name=leaf1 -infrahubctl render vrf_yang_transform device_name=leaf7 -infrahubctl render mlag_yang_transform device_name=leaf1 -infrahubctl render bgp_yang_transform device_name=spine1 -``` - -Devices without applicable config return `[]` (e.g. `mlag_yang_transform` on a spine, `vxlan_yang_transform` on a non-VTEP device). - -## Directory Structure - -``` -infrahub/transforms/ -├── queries/ # GraphQL .gql files -├── templates/ # Jinja2 .j2 files -└── tests/ # Unit test fixtures (mock input + expected output) -``` - -## Adding a New Transform - -1. Create the GraphQL query in `queries/_intent.gql` -2. Create the Jinja2 template in `templates/_yang.j2` -3. Register both in `.infrahub.yml` (query + jinja2_transform) -4. Add test fixtures in `tests/_yang/` diff --git a/infrahub/transforms/queries/bgp_intent.gql b/infrahub/transforms/queries/bgp_intent.gql deleted file mode 100644 index 7650840..0000000 --- a/infrahub/transforms/queries/bgp_intent.gql +++ /dev/null @@ -1,105 +0,0 @@ -query BgpIntent($device_name: String!) { - InfraBGPRouterConfig(device__name__value: $device_name) { - edges { - node { - router_id { value } - default_ipv4_unicast { value } - log_neighbor_changes { value } - ecmp_max_paths { value } - ecmp_max_ecmp { value } - ebgp_distance { value } - ibgp_distance { value } - local_distance { value } - local_asn { - node { - asn { value } - } - } - peer_groups { - edges { - node { - name { value } - peer_group_type { value } - update_source { value } - ebgp_multihop { value } - send_community { value } - next_hop_self { value } - next_hop_unchanged { value } - maximum_routes { value } - maximum_routes_warning_only { value } - remote_asn { - node { - asn { value } - } - } - } - } - } - sessions { - edges { - node { - peer_address { value } - description { value } - enabled { value } - peer_group { - node { - name { value } - local_identifier { value } - } - } - remote_asn { - node { - asn { value } - } - } - vrf { - node { - name { value } - } - } - peer_device { - node { - name { value } - } - } - } - } - } - } - } - } - InfraBGPAddressFamily(device__name__value: $device_name) { - edges { - node { - afi { value } - safi { value } - vrf { - node { - name { value } - } - } - active_peer_groups { - edges { - node { - name { value } - } - } - } - active_sessions { - edges { - node { - peer_address { value } - } - } - } - networks { - edges { - node { - address { value } - } - } - } - } - } - } -} diff --git a/infrahub/transforms/queries/interface_intent.gql b/infrahub/transforms/queries/interface_intent.gql deleted file mode 100644 index 1cb1106..0000000 --- a/infrahub/transforms/queries/interface_intent.gql +++ /dev/null @@ -1,155 +0,0 @@ -query InterfaceIntent($device_name: String!) { - # Loopback interfaces - InfraInterfaceLoopback(device__name__value: $device_name) { - edges { - node { - name { - value - } - description { - value - } - enabled { - value - } - mtu { - value - } - ip_addresses { - edges { - node { - address { - value - } - } - } - } - } - } - } - # Ethernet interfaces - InfraInterfaceEthernet(device__name__value: $device_name) { - edges { - node { - name { - value - } - description { - value - } - enabled { - value - } - mtu { - value - } - speed { - value - } - mode { - value - } - lag { - node { - name { - value - } - } - } - ip_addresses { - edges { - node { - address { - value - } - } - } - } - } - } - } - # VLAN SVI interfaces - InfraInterfaceVlan(device__name__value: $device_name) { - edges { - node { - name { - value - } - description { - value - } - enabled { - value - } - mtu { - value - } - virtual_router_address { - value - } - autostate { - value - } - vlan { - node { - vlan_id { - value - } - } - } - ip_addresses { - edges { - node { - address { - value - } - } - } - } - } - } - } - # LAG / Port-Channel interfaces - InfraInterfaceLag(device__name__value: $device_name) { - edges { - node { - name { - value - } - description { - value - } - enabled { - value - } - mtu { - value - } - lacp_mode { - value - } - mlag_id { - value - } - members { - edges { - node { - name { - value - } - } - } - } - ip_addresses { - edges { - node { - address { - value - } - } - } - } - } - } - } -} diff --git a/infrahub/transforms/queries/mlag_intent.gql b/infrahub/transforms/queries/mlag_intent.gql deleted file mode 100644 index 2d07d8c..0000000 --- a/infrahub/transforms/queries/mlag_intent.gql +++ /dev/null @@ -1,53 +0,0 @@ -query MlagIntent($device_name: String!) { - InfraMlagPeerConfig(device__name__value: $device_name) { - edges { - node { - local_interface_ip { value } - peer_address { value } - heartbeat_peer_ip { value } - device { - node { - name { value } - } - } - mlag_domain { - node { - domain_id { value } - virtual_mac { value } - heartbeat_vrf { value } - dual_primary_detection { value } - dual_primary_delay { value } - dual_primary_action { value } - devices { - edges { - node { - name { value } - } - } - } - peer_vlan { - node { - vlan_id { value } - } - } - ibgp_vlan { - node { - vlan_id { value } - } - } - } - } - local_interface { - node { - name { value } - } - } - peer_link { - node { - name { value } - } - } - } - } - } -} diff --git a/infrahub/transforms/queries/vlan_intent.gql b/infrahub/transforms/queries/vlan_intent.gql deleted file mode 100644 index bcd0f7b..0000000 --- a/infrahub/transforms/queries/vlan_intent.gql +++ /dev/null @@ -1,92 +0,0 @@ -query VlanIntent($device_name: String!) { - # VLANs reachable via VTEP VLAN-VNI mappings (L2/VXLAN VLANs) - InfraVTEP(device__name__value: $device_name) { - edges { - node { - source_address { - value - } - udp_port { - value - } - vlan_vni_mappings { - edges { - node { - vlan { - node { - vlan_id { - value - } - name { - value - } - status { - value - } - vlan_type { - value - } - trunk_groups { - value - } - stp_enabled { - value - } - vni { - node { - vni { - value - } - vni_type { - value - } - } - } - } - } - } - } - } - } - } - } - # VLANs reachable via SVI interfaces (MLAG, routing, and other local VLANs) - InfraInterfaceVlan(device__name__value: $device_name) { - edges { - node { - vlan { - node { - vlan_id { - value - } - name { - value - } - status { - value - } - vlan_type { - value - } - trunk_groups { - value - } - stp_enabled { - value - } - vni { - node { - vni { - value - } - vni_type { - value - } - } - } - } - } - } - } - } -} diff --git a/infrahub/transforms/queries/vrf_intent.gql b/infrahub/transforms/queries/vrf_intent.gql deleted file mode 100644 index 0d48b2e..0000000 --- a/infrahub/transforms/queries/vrf_intent.gql +++ /dev/null @@ -1,50 +0,0 @@ -query VrfIntent($device_name: String!) { - InfraVRFDeviceAssignment(device__name__value: $device_name) { - edges { - node { - route_distinguisher { value } - vrf { - node { - name { value } - description { value } - route_distinguisher { value } - l3vni { - node { - vni { value } - vni_type { value } - } - } - import_targets { - edges { - node { - target { value } - } - } - } - export_targets { - edges { - node { - target { value } - } - } - } - } - } - import_targets { - edges { - node { - target { value } - } - } - } - export_targets { - edges { - node { - target { value } - } - } - } - } - } - } -} diff --git a/infrahub/transforms/queries/vxlan_intent.gql b/infrahub/transforms/queries/vxlan_intent.gql deleted file mode 100644 index ed182c6..0000000 --- a/infrahub/transforms/queries/vxlan_intent.gql +++ /dev/null @@ -1,100 +0,0 @@ -query VxlanIntent($device_name: String!) { - # VTEP configuration for the device - InfraVTEP(device__name__value: $device_name) { - edges { - node { - source_address { - value - } - udp_port { - value - } - learn_restrict { - value - } - source_interface { - node { - name { - value - } - } - } - # VLAN-to-VNI mappings (L2 VXLAN) - vlan_vni_mappings { - edges { - node { - description { - value - } - vlan { - node { - vlan_id { - value - } - name { - value - } - } - } - vni { - node { - vni { - value - } - vni_type { - value - } - } - } - } - } - } - } - } - } - # VRF-to-VNI mappings (L3 VXLAN) via VRF device assignments - InfraVRFDeviceAssignment(device__name__value: $device_name) { - edges { - node { - route_distinguisher { - value - } - vrf { - node { - name { - value - } - l3vni { - node { - vni { - value - } - vni_type { - value - } - } - } - import_targets { - edges { - node { - target { - value - } - } - } - } - export_targets { - edges { - node { - target { - value - } - } - } - } - } - } - } - } - } -} diff --git a/infrahub/transforms/templates/bgp_yang.j2 b/infrahub/transforms/templates/bgp_yang.j2 deleted file mode 100644 index 5bfd01c..0000000 --- a/infrahub/transforms/templates/bgp_yang.j2 +++ /dev/null @@ -1,194 +0,0 @@ -{# - bgp_yang.j2 — Produce a JSON object with the complete BGP configuration - for a single device. - - Input: GraphQL response from bgp_intent query. - Returns [] if the device has no BGP router config. - - Output structure: - { - "bgp": { - "global": { asn, router_id, flags, distance, ecmp }, - "peer_groups": [ ... ], - "neighbors": [ ... global-VRF sessions ... ], - "address_families": [ ... global-VRF AFs ... ], - "vrf_neighbors": [ ... VRF-scoped sessions ... ], - "vrf_address_families": [ ... VRF-scoped AFs ... ] - } - } -#} -{%- set router_configs = data.InfraBGPRouterConfig.edges -%} -{%- set af_edges = data.InfraBGPAddressFamily.edges -%} - -{%- if router_configs | length == 0 -%} -[] -{%- else -%} - {%- set rc = router_configs[0].node -%} - - {#— Global section —#} - {%- set asn = none -%} - {%- if rc.local_asn is defined and rc.local_asn is not none and rc.local_asn.node is not none -%} - {%- set asn = rc.local_asn.node.asn.value -%} - {%- endif -%} - - {#— Build peer_groups list —#} - {%- set peer_groups = [] -%} - {%- for pg_edge in rc.peer_groups.edges -%} - {%- set pg = pg_edge.node -%} - {%- set pg_remote_asn = none -%} - {%- if pg.remote_asn is defined and pg.remote_asn is not none and pg.remote_asn.node is not none -%} - {%- set pg_remote_asn = pg.remote_asn.node.asn.value -%} - {%- endif -%} - {%- set pg_send_community = none -%} - {%- if pg.send_community is defined and pg.send_community is not none and pg.send_community.value is not none and pg.send_community.value != "none" -%} - {%- set pg_send_community = pg.send_community.value -%} - {%- endif -%} - {%- set pg_update_source = none -%} - {%- if pg.update_source is defined and pg.update_source is not none and pg.update_source.value is not none -%} - {%- set pg_update_source = pg.update_source.value -%} - {%- endif -%} - {%- set pg_ebgp_multihop = none -%} - {%- if pg.ebgp_multihop is defined and pg.ebgp_multihop is not none and pg.ebgp_multihop.value is not none -%} - {%- set pg_ebgp_multihop = pg.ebgp_multihop.value -%} - {%- endif -%} - {%- set pg_max_routes = none -%} - {%- if pg.maximum_routes is defined and pg.maximum_routes is not none and pg.maximum_routes.value is not none -%} - {%- set pg_max_routes = pg.maximum_routes.value -%} - {%- endif -%} - {%- set _ = peer_groups.append({ - "name": pg.name.value, - "type": pg.peer_group_type.value, - "remote_asn": pg_remote_asn, - "update_source": pg_update_source, - "ebgp_multihop": pg_ebgp_multihop, - "send_community": pg_send_community, - "next_hop_self": pg.next_hop_self.value, - "next_hop_unchanged": pg.next_hop_unchanged.value, - "maximum_routes": pg_max_routes, - "maximum_routes_warning_only": pg.maximum_routes_warning_only.value - }) -%} - {%- endfor -%} - - {#— Split sessions into global and VRF-scoped —#} - {%- set neighbors = [] -%} - {%- set vrf_neighbors = [] -%} - {%- for sess_edge in rc.sessions.edges -%} - {%- set sess = sess_edge.node -%} - - {%- set sess_peer_group = none -%} - {%- if sess.peer_group is defined and sess.peer_group is not none and sess.peer_group.node is not none -%} - {%- set sess_peer_group = sess.peer_group.node.name.value -%} - {%- endif -%} - - {%- set sess_remote_asn = none -%} - {%- if sess.remote_asn is defined and sess.remote_asn is not none and sess.remote_asn.node is not none -%} - {%- set sess_remote_asn = sess.remote_asn.node.asn.value -%} - {%- endif -%} - - {%- set sess_vrf = none -%} - {%- if sess.vrf is defined and sess.vrf is not none and sess.vrf.node is not none -%} - {%- set sess_vrf = sess.vrf.node.name.value -%} - {%- endif -%} - - {%- set sess_obj = { - "peer_address": sess.peer_address.value, - "description": sess.description.value | default(none), - "enabled": sess.enabled.value, - "peer_group": sess_peer_group, - "remote_asn": sess_remote_asn - } -%} - - {%- if sess_vrf is not none -%} - {%- set vrf_sess_obj = { - "peer_address": sess.peer_address.value, - "description": sess.description.value | default(none), - "enabled": sess.enabled.value, - "peer_group": sess_peer_group, - "remote_asn": sess_remote_asn, - "vrf": sess_vrf - } -%} - {%- set _ = vrf_neighbors.append(vrf_sess_obj) -%} - {%- else -%} - {%- set _ = neighbors.append(sess_obj) -%} - {%- endif -%} - {%- endfor -%} - - {#— Split address families into global and VRF-scoped —#} - {%- set address_families = [] -%} - {%- set vrf_address_families = [] -%} - {%- for af_edge in af_edges -%} - {%- set af = af_edge.node -%} - - {%- set af_vrf = none -%} - {%- if af.vrf is defined and af.vrf is not none and af.vrf.node is not none -%} - {%- set af_vrf = af.vrf.node.name.value -%} - {%- endif -%} - - {%- set af_active_pgs = [] -%} - {%- for pg_edge in af.active_peer_groups.edges -%} - {%- set _ = af_active_pgs.append(pg_edge.node.name.value) -%} - {%- endfor -%} - - {%- set af_active_sess = [] -%} - {%- if af.active_sessions is defined and af.active_sessions is not none -%} - {%- for s_edge in af.active_sessions.edges -%} - {%- set _ = af_active_sess.append(s_edge.node.peer_address.value) -%} - {%- endfor -%} - {%- endif -%} - - {%- set af_networks = [] -%} - {%- if af.networks is defined and af.networks is not none -%} - {%- for net_edge in af.networks.edges -%} - {%- set _ = af_networks.append(net_edge.node.address.value) -%} - {%- endfor -%} - {%- endif -%} - - {%- set af_obj = { - "afi": af.afi.value, - "safi": af.safi.value, - "active_peer_groups": af_active_pgs, - "active_sessions": af_active_sess, - "networks": af_networks - } -%} - - {%- if af_vrf is not none -%} - {%- set vrf_af_obj = { - "afi": af.afi.value, - "safi": af.safi.value, - "vrf": af_vrf, - "active_peer_groups": af_active_pgs, - "active_sessions": af_active_sess, - "networks": af_networks - } -%} - {%- set _ = vrf_address_families.append(vrf_af_obj) -%} - {%- else -%} - {%- set _ = address_families.append(af_obj) -%} - {%- endif -%} - {%- endfor -%} - - {%- set result = { - "bgp": { - "global": { - "asn": asn, - "router_id": rc.router_id.value, - "default_ipv4_unicast": rc.default_ipv4_unicast.value, - "log_neighbor_changes": rc.log_neighbor_changes.value, - "distance": { - "ebgp": rc.ebgp_distance.value, - "ibgp": rc.ibgp_distance.value, - "local": rc.local_distance.value - }, - "ecmp": { - "max_paths": rc.ecmp_max_paths.value, - "max_ecmp": rc.ecmp_max_ecmp.value - } - }, - "peer_groups": peer_groups, - "neighbors": neighbors, - "address_families": address_families, - "vrf_neighbors": vrf_neighbors, - "vrf_address_families": vrf_address_families - } - } -%} -{{ result | tojson(indent=2) }} -{%- endif -%} diff --git a/infrahub/transforms/templates/interface_yang.j2 b/infrahub/transforms/templates/interface_yang.j2 deleted file mode 100644 index 2739c2b..0000000 --- a/infrahub/transforms/templates/interface_yang.j2 +++ /dev/null @@ -1,101 +0,0 @@ -{# - interface_yang.j2 — Produce a JSON array of interface configuration objects. - - Input: GraphQL response from interface_intent query. - Returns all interface types (loopback, ethernet, vlan, lag) for the device, - each with a "type" discriminator and type-specific attributes. -#} -{%- set interfaces = [] -%} - -{#— Loopback interfaces —#} -{%- for edge in data.InfraInterfaceLoopback.edges -%} - {%- set iface = edge.node -%} - {%- set ip_list = [] -%} - {%- for ip_edge in iface.ip_addresses.edges -%} - {%- set _ = ip_list.append(ip_edge.node.address.value) -%} - {%- endfor -%} - {%- set _ = interfaces.append({ - "type": "loopback", - "name": iface.name.value, - "description": iface.description.value | default(none), - "enabled": iface.enabled.value, - "mtu": iface.mtu.value | default(none), - "ip_addresses": ip_list - }) -%} -{%- endfor -%} - -{#— Ethernet interfaces —#} -{%- for edge in data.InfraInterfaceEthernet.edges -%} - {%- set iface = edge.node -%} - {%- set ip_list = [] -%} - {%- for ip_edge in iface.ip_addresses.edges -%} - {%- set _ = ip_list.append(ip_edge.node.address.value) -%} - {%- endfor -%} - {%- set lag_name = none -%} - {%- if iface.lag is defined and iface.lag is not none and iface.lag.node is not none -%} - {%- set lag_name = iface.lag.node.name.value -%} - {%- endif -%} - {%- set _ = interfaces.append({ - "type": "ethernet", - "name": iface.name.value, - "description": iface.description.value | default(none), - "enabled": iface.enabled.value, - "mtu": iface.mtu.value | default(none), - "speed": iface.speed.value | default(none), - "mode": iface.mode.value | default(none), - "lag": lag_name, - "ip_addresses": ip_list - }) -%} -{%- endfor -%} - -{#— VLAN SVI interfaces —#} -{%- for edge in data.InfraInterfaceVlan.edges -%} - {%- set iface = edge.node -%} - {%- set ip_list = [] -%} - {%- for ip_edge in iface.ip_addresses.edges -%} - {%- set _ = ip_list.append(ip_edge.node.address.value) -%} - {%- endfor -%} - {%- set vlan_id = none -%} - {%- if iface.vlan is defined and iface.vlan is not none and iface.vlan.node is not none -%} - {%- set vlan_id = iface.vlan.node.vlan_id.value -%} - {%- endif -%} - {%- set _ = interfaces.append({ - "type": "vlan", - "name": iface.name.value, - "description": iface.description.value | default(none), - "enabled": iface.enabled.value, - "mtu": iface.mtu.value | default(none), - "vlan_id": vlan_id, - "virtual_router_address": iface.virtual_router_address.value | default(none), - "autostate": iface.autostate.value, - "ip_addresses": ip_list - }) -%} -{%- endfor -%} - -{#— LAG / Port-Channel interfaces —#} -{%- for edge in data.InfraInterfaceLag.edges -%} - {%- set iface = edge.node -%} - {%- set ip_list = [] -%} - {%- for ip_edge in iface.ip_addresses.edges -%} - {%- set _ = ip_list.append(ip_edge.node.address.value) -%} - {%- endfor -%} - {%- set member_list = [] -%} - {%- for member_edge in iface.members.edges -%} - {%- set _ = member_list.append(member_edge.node.name.value) -%} - {%- endfor -%} - {%- set _ = interfaces.append({ - "type": "lag", - "name": iface.name.value, - "description": iface.description.value | default(none), - "enabled": iface.enabled.value, - "mtu": iface.mtu.value | default(none), - "lacp_mode": iface.lacp_mode.value | default(none), - "mlag_id": iface.mlag_id.value | default(none), - "members": member_list, - "ip_addresses": ip_list - }) -%} -{%- endfor -%} - -{#— Sort by name and emit JSON array —#} -{%- set sorted_ifaces = interfaces | sort(attribute='name') -%} -{{ sorted_ifaces | tojson(indent=2) }} diff --git a/infrahub/transforms/templates/mlag_yang.j2 b/infrahub/transforms/templates/mlag_yang.j2 deleted file mode 100644 index 915413f..0000000 --- a/infrahub/transforms/templates/mlag_yang.j2 +++ /dev/null @@ -1,90 +0,0 @@ -{# - mlag_yang.j2 — Produce a JSON object with the MLAG configuration payload - for a single device, targeting Arista-native YANG paths. - - Input: GraphQL response from mlag_intent query. - Returns an empty array [] if the device has no MLAG peer config (e.g. spines). - - Output structure: - { - "mlag": { - "config": { ... }, # /arista-mlag-augments:mlag/config - "dual_primary_detection": { ... }, - "virtual_mac": "...", - "peer_vlan_id": ..., - "ibgp_vlan_id": ..., - "local_interface_ip": "..." - } - } -#} -{%- set peer_configs = data.InfraMlagPeerConfig.edges -%} - -{%- if peer_configs | length == 0 -%} -[] -{%- else -%} - {%- set cfg = peer_configs[0].node -%} - - {#— Resolve local interface name —#} - {%- set local_iface_name = none -%} - {%- if cfg.local_interface is defined and cfg.local_interface is not none and cfg.local_interface.node is not none -%} - {%- set local_iface_name = cfg.local_interface.node.name.value -%} - {%- endif -%} - - {#— Resolve peer-link name —#} - {%- set peer_link_name = none -%} - {%- if cfg.peer_link is defined and cfg.peer_link is not none and cfg.peer_link.node is not none -%} - {%- set peer_link_name = cfg.peer_link.node.name.value -%} - {%- endif -%} - - {#— Resolve MLAG domain attributes —#} - {%- set domain_id = none -%} - {%- set virtual_mac = none -%} - {%- set heartbeat_vrf = none -%} - {%- set dual_primary_detection = false -%} - {%- set dual_primary_delay = none -%} - {%- set dual_primary_action = none -%} - {%- set peer_vlan_id = none -%} - {%- set ibgp_vlan_id = none -%} - - {%- if cfg.mlag_domain is defined and cfg.mlag_domain is not none and cfg.mlag_domain.node is not none -%} - {%- set domain = cfg.mlag_domain.node -%} - {%- set domain_id = domain.domain_id.value -%} - {%- set virtual_mac = domain.virtual_mac.value | default(none) -%} - {%- set heartbeat_vrf = domain.heartbeat_vrf.value | default("mgmt") -%} - {%- set dual_primary_detection = domain.dual_primary_detection.value | default(false) -%} - {%- set dual_primary_delay = domain.dual_primary_delay.value | default(none) -%} - {%- set dual_primary_action = domain.dual_primary_action.value | default(none) -%} - - {%- if domain.peer_vlan is defined and domain.peer_vlan is not none and domain.peer_vlan.node is not none -%} - {%- set peer_vlan_id = domain.peer_vlan.node.vlan_id.value -%} - {%- endif -%} - - {%- if domain.ibgp_vlan is defined and domain.ibgp_vlan is not none and domain.ibgp_vlan.node is not none -%} - {%- set ibgp_vlan_id = domain.ibgp_vlan.node.vlan_id.value -%} - {%- endif -%} - {%- endif -%} - - {%- set result = { - "mlag": { - "config": { - "domain-id": domain_id, - "peer-link": peer_link_name, - "local-interface": local_iface_name, - "peer-address": cfg.peer_address.value, - "shutdown": false - }, - "dual_primary_detection": { - "enabled": dual_primary_detection, - "delay": dual_primary_delay, - "action": dual_primary_action, - "heartbeat_peer_ip": cfg.heartbeat_peer_ip.value, - "heartbeat_vrf": heartbeat_vrf - }, - "virtual_mac": virtual_mac, - "peer_vlan_id": peer_vlan_id, - "ibgp_vlan_id": ibgp_vlan_id, - "local_interface_ip": cfg.local_interface_ip.value - } - } -%} -{{ result | tojson(indent=2) }} -{%- endif -%} diff --git a/infrahub/transforms/templates/vlan_yang.j2 b/infrahub/transforms/templates/vlan_yang.j2 deleted file mode 100644 index 423fc02..0000000 --- a/infrahub/transforms/templates/vlan_yang.j2 +++ /dev/null @@ -1,67 +0,0 @@ -{# - vlan_yang.j2 — Produce a JSON array of VLAN configuration objects. - - Input: GraphQL response from vlan_intent query. - The query returns VLANs from two sources: - 1. data.InfraVTEP[].vlan_vni_mappings[].vlan (L2/VXLAN VLANs) - 2. data.InfraInterfaceVlan[].vlan (SVI/routing/MLAG VLANs) - - We merge both sources, deduplicate by vlan_id, and emit one object per VLAN. -#} -{%- set vlans = {} -%} - -{#— Collect VLANs from VTEP VLAN-VNI mappings —#} -{%- for vtep_edge in data.InfraVTEP.edges -%} - {%- for mapping_edge in vtep_edge.node.vlan_vni_mappings.edges -%} - {%- set vlan_node = mapping_edge.node.vlan.node -%} - {%- set vid = vlan_node.vlan_id.value | string -%} - {%- if vid not in vlans -%} - {%- set vni_val = none -%} - {%- set vni_type_val = none -%} - {%- if vlan_node.vni is defined and vlan_node.vni is not none and vlan_node.vni.node is not none -%} - {%- set vni_val = vlan_node.vni.node.vni.value -%} - {%- set vni_type_val = vlan_node.vni.node.vni_type.value -%} - {%- endif -%} - {%- set _ = vlans.update({vid: { - "vlan_id": vlan_node.vlan_id.value, - "name": vlan_node.name.value, - "status": vlan_node.status.value | default('') | upper, - "vlan_type": vlan_node.vlan_type.value | default(none), - "trunk_groups": vlan_node.trunk_groups.value | default([]), - "stp_enabled": vlan_node.stp_enabled.value, - "vni": vni_val, - "vni_type": vni_type_val - }}) -%} - {%- endif -%} - {%- endfor -%} -{%- endfor -%} - -{#— Collect VLANs from SVI interfaces —#} -{%- for svi_edge in data.InfraInterfaceVlan.edges -%} - {%- if svi_edge.node.vlan is defined and svi_edge.node.vlan is not none and svi_edge.node.vlan.node is not none -%} - {%- set vlan_node = svi_edge.node.vlan.node -%} - {%- set vid = vlan_node.vlan_id.value | string -%} - {%- if vid not in vlans -%} - {%- set vni_val = none -%} - {%- set vni_type_val = none -%} - {%- if vlan_node.vni is defined and vlan_node.vni is not none and vlan_node.vni.node is not none -%} - {%- set vni_val = vlan_node.vni.node.vni.value -%} - {%- set vni_type_val = vlan_node.vni.node.vni_type.value -%} - {%- endif -%} - {%- set _ = vlans.update({vid: { - "vlan_id": vlan_node.vlan_id.value, - "name": vlan_node.name.value, - "status": vlan_node.status.value | default('') | upper, - "vlan_type": vlan_node.vlan_type.value | default(none), - "trunk_groups": vlan_node.trunk_groups.value | default([]), - "stp_enabled": vlan_node.stp_enabled.value, - "vni": vni_val, - "vni_type": vni_type_val - }}) -%} - {%- endif -%} - {%- endif -%} -{%- endfor -%} - -{#— Sort by vlan_id and emit JSON array —#} -{%- set sorted_vlans = vlans.values() | sort(attribute='vlan_id') -%} -{{ sorted_vlans | tojson(indent=2) }} diff --git a/infrahub/transforms/templates/vrf_yang.j2 b/infrahub/transforms/templates/vrf_yang.j2 deleted file mode 100644 index cae8f91..0000000 --- a/infrahub/transforms/templates/vrf_yang.j2 +++ /dev/null @@ -1,78 +0,0 @@ -{# - vrf_yang.j2 — Produce a JSON array of VRF configuration objects. - - Input: GraphQL response from vrf_intent query. - For each VRFDeviceAssignment, produce one VRF config entry with: - - device-specific RD (falls back to VRF-level RD if not set on assignment) - - L3VNI from the VRF's l3vni relationship - - import/export targets: device-level if present, otherwise VRF-level -#} -{%- set vrf_list = [] -%} - -{%- for assignment_edge in data.InfraVRFDeviceAssignment.edges -%} - {%- set assignment = assignment_edge.node -%} - - {#— Resolve VRF node —#} - {%- set vrf_name = none -%} - {%- set vrf_description = none -%} - {%- set l3vni = none -%} - {%- set vrf_level_import_rts = [] -%} - {%- set vrf_level_export_rts = [] -%} - - {%- if assignment.vrf is defined and assignment.vrf is not none and assignment.vrf.node is not none -%} - {%- set vrf_node = assignment.vrf.node -%} - {%- set vrf_name = vrf_node.name.value -%} - {%- set vrf_description = vrf_node.description.value | default(none) -%} - - {%- if vrf_node.l3vni is defined and vrf_node.l3vni is not none and vrf_node.l3vni.node is not none -%} - {%- set l3vni = vrf_node.l3vni.node.vni.value -%} - {%- endif -%} - - {%- for rt_edge in vrf_node.import_targets.edges -%} - {%- set _ = vrf_level_import_rts.append(rt_edge.node.target.value) -%} - {%- endfor -%} - {%- for rt_edge in vrf_node.export_targets.edges -%} - {%- set _ = vrf_level_export_rts.append(rt_edge.node.target.value) -%} - {%- endfor -%} - {%- endif -%} - - {#— Resolve route_distinguisher: device-specific first, fall back to VRF-level —#} - {%- set rd = none -%} - {%- if assignment.route_distinguisher is defined and assignment.route_distinguisher is not none and assignment.route_distinguisher.value is not none and assignment.route_distinguisher.value != "" -%} - {%- set rd = assignment.route_distinguisher.value -%} - {%- elif assignment.vrf is defined and assignment.vrf is not none and assignment.vrf.node is not none and assignment.vrf.node.route_distinguisher is defined and assignment.vrf.node.route_distinguisher is not none -%} - {%- set rd = assignment.vrf.node.route_distinguisher.value | default(none) -%} - {%- endif -%} - - {#— Resolve import targets: device-level if present, otherwise VRF-level —#} - {%- set import_rts = [] -%} - {%- if assignment.import_targets is defined and assignment.import_targets is not none and assignment.import_targets.edges | length > 0 -%} - {%- for rt_edge in assignment.import_targets.edges -%} - {%- set _ = import_rts.append(rt_edge.node.target.value) -%} - {%- endfor -%} - {%- else -%} - {%- set import_rts = vrf_level_import_rts -%} - {%- endif -%} - - {#— Resolve export targets: device-level if present, otherwise VRF-level —#} - {%- set export_rts = [] -%} - {%- if assignment.export_targets is defined and assignment.export_targets is not none and assignment.export_targets.edges | length > 0 -%} - {%- for rt_edge in assignment.export_targets.edges -%} - {%- set _ = export_rts.append(rt_edge.node.target.value) -%} - {%- endfor -%} - {%- else -%} - {%- set export_rts = vrf_level_export_rts -%} - {%- endif -%} - - {%- set _ = vrf_list.append({ - "vrf_name": vrf_name, - "description": vrf_description, - "route_distinguisher": rd, - "l3vni": l3vni, - "import_targets": import_rts, - "export_targets": export_rts, - "redistribute_connected": true - }) -%} -{%- endfor -%} - -{{ vrf_list | tojson(indent=2) }} diff --git a/infrahub/transforms/templates/vxlan_yang.j2 b/infrahub/transforms/templates/vxlan_yang.j2 deleted file mode 100644 index c57d036..0000000 --- a/infrahub/transforms/templates/vxlan_yang.j2 +++ /dev/null @@ -1,88 +0,0 @@ -{# - vxlan_yang.j2 — Produce a JSON object representing the VXLAN/VTEP configuration - for the device, including VLAN-to-VNI mappings and VRF-to-VNI mappings. - - Input: GraphQL response from vxlan_intent query. -#} -{%- set vtep_edges = data.InfraVTEP.edges -%} -{%- set vrf_edges = data.InfraVRFDeviceAssignment.edges -%} - -{#— Build VTEP section (there is one VTEP per device) —#} -{%- if vtep_edges | length > 0 -%} - {%- set vtep = vtep_edges[0].node -%} - {%- set source_iface = none -%} - {%- if vtep.source_interface is defined and vtep.source_interface is not none and vtep.source_interface.node is not none -%} - {%- set source_iface = vtep.source_interface.node.name.value -%} - {%- endif -%} - - {#— Build VLAN-to-VNI mapping list —#} - {%- set vlan_vni_list = [] -%} - {%- for mapping_edge in vtep.vlan_vni_mappings.edges -%} - {%- set m = mapping_edge.node -%} - {%- set vlan_id = none -%} - {%- set vlan_name = none -%} - {%- if m.vlan is defined and m.vlan is not none and m.vlan.node is not none -%} - {%- set vlan_id = m.vlan.node.vlan_id.value -%} - {%- set vlan_name = m.vlan.node.name.value -%} - {%- endif -%} - {%- set vni_val = none -%} - {%- set vni_type_val = none -%} - {%- if m.vni is defined and m.vni is not none and m.vni.node is not none -%} - {%- set vni_val = m.vni.node.vni.value -%} - {%- set vni_type_val = m.vni.node.vni_type.value -%} - {%- endif -%} - {%- set _ = vlan_vni_list.append({ - "vlan_id": vlan_id, - "vlan_name": vlan_name, - "vni": vni_val, - "vni_type": vni_type_val - }) -%} - {%- endfor -%} - - {#— Build VRF-to-VNI mapping list —#} - {%- set vrf_vni_list = [] -%} - {%- for vrf_edge in vrf_edges -%} - {%- set assignment = vrf_edge.node -%} - {%- set vrf_name = none -%} - {%- set l3vni = none -%} - {%- set import_rts = [] -%} - {%- set export_rts = [] -%} - {%- if assignment.vrf is defined and assignment.vrf is not none and assignment.vrf.node is not none -%} - {%- set vrf_node = assignment.vrf.node -%} - {%- set vrf_name = vrf_node.name.value -%} - {%- if vrf_node.l3vni is defined and vrf_node.l3vni is not none and vrf_node.l3vni.node is not none -%} - {%- set l3vni = vrf_node.l3vni.node.vni.value -%} - {%- endif -%} - {%- for rt_edge in vrf_node.import_targets.edges -%} - {%- set _ = import_rts.append(rt_edge.node.target.value) -%} - {%- endfor -%} - {%- for rt_edge in vrf_node.export_targets.edges -%} - {%- set _ = export_rts.append(rt_edge.node.target.value) -%} - {%- endfor -%} - {%- endif -%} - {%- set _ = vrf_vni_list.append({ - "vrf": vrf_name, - "l3vni": l3vni, - "route_distinguisher": assignment.route_distinguisher.value | default(none), - "import_targets": import_rts, - "export_targets": export_rts - }) -%} - {%- endfor -%} - - {%- set result = { - "vtep": { - "source_address": vtep.source_address.value, - "source_interface": source_iface, - "udp_port": vtep.udp_port.value, - "learn_restrict": vtep.learn_restrict.value | default(none), - "vlan_vni_mappings": vlan_vni_list | sort(attribute='vlan_id'), - "vrf_vni_mappings": vrf_vni_list - } - } -%} -{%- else -%} - {%- set result = { - "vtep": none, - "vrf_vni_mappings": [] - } -%} -{%- endif -%} -{{ result | tojson(indent=2) }} diff --git a/infrahub/transforms/tests/bgp_yang/leaf1/input.json b/infrahub/transforms/tests/bgp_yang/leaf1/input.json deleted file mode 100644 index 06bc206..0000000 --- a/infrahub/transforms/tests/bgp_yang/leaf1/input.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "data": { - "InfraBGPRouterConfig": { - "edges": [ - { - "node": { - "router_id": { "value": "10.0.250.11" }, - "default_ipv4_unicast": { "value": false }, - "log_neighbor_changes": { "value": true }, - "ecmp_max_paths": { "value": 4 }, - "ecmp_max_ecmp": { "value": 64 }, - "ebgp_distance": { "value": 20 }, - "ibgp_distance": { "value": 200 }, - "local_distance": { "value": 200 }, - "local_asn": { - "node": { - "asn": { "value": 65001 } - } - }, - "peer_groups": { - "edges": [ - { - "node": { - "name": { "value": "underlay" }, - "peer_group_type": { "value": "underlay" }, - "update_source": { "value": null }, - "ebgp_multihop": { "value": null }, - "send_community": { "value": "none" }, - "next_hop_self": { "value": false }, - "next_hop_unchanged": { "value": false }, - "maximum_routes": { "value": 12000 }, - "maximum_routes_warning_only": { "value": true }, - "remote_asn": { - "node": { - "asn": { "value": 65000 } - } - } - } - }, - { - "node": { - "name": { "value": "underlay_ibgp" }, - "peer_group_type": { "value": "underlay_ibgp" }, - "update_source": { "value": null }, - "ebgp_multihop": { "value": null }, - "send_community": { "value": "none" }, - "next_hop_self": { "value": true }, - "next_hop_unchanged": { "value": false }, - "maximum_routes": { "value": 12000 }, - "maximum_routes_warning_only": { "value": true }, - "remote_asn": { - "node": { - "asn": { "value": 65001 } - } - } - } - }, - { - "node": { - "name": { "value": "evpn" }, - "peer_group_type": { "value": "evpn" }, - "update_source": { "value": "Loopback0" }, - "ebgp_multihop": { "value": 3 }, - "send_community": { "value": "extended" }, - "next_hop_self": { "value": false }, - "next_hop_unchanged": { "value": false }, - "maximum_routes": { "value": 12000 }, - "maximum_routes_warning_only": { "value": true }, - "remote_asn": { - "node": { - "asn": { "value": 65000 } - } - } - } - } - ] - }, - "sessions": { - "edges": [ - { - "node": { - "peer_address": { "value": "10.0.1.0" }, - "description": { "value": "underlay to spine1" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "underlay" }, "local_identifier": { "value": "leaf1__underlay" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine1" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.2.0" }, - "description": { "value": "underlay to spine2" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "underlay" }, "local_identifier": { "value": "leaf1__underlay" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine2" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.3.1" }, - "description": { "value": "iBGP to leaf2" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "underlay_ibgp" }, "local_identifier": { "value": "leaf1__underlay_ibgp" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf2" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.1" }, - "description": { "value": "EVPN to spine1" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "leaf1__evpn" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine1" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.2" }, - "description": { "value": "EVPN to spine2" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "leaf1__evpn" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine2" } } } - } - } - ] - } - } - } - ] - }, - "InfraBGPAddressFamily": { - "edges": [ - { - "node": { - "afi": { "value": "ipv4" }, - "safi": { "value": "unicast" }, - "vrf": { "node": null }, - "active_peer_groups": { - "edges": [ - { "node": { "name": { "value": "underlay" } } }, - { "node": { "name": { "value": "underlay_ibgp" } } } - ] - }, - "active_sessions": { "edges": [] }, - "networks": { - "edges": [ - { "node": { "address": { "value": "10.0.250.11/32" } } }, - { "node": { "address": { "value": "10.0.255.11/32" } } } - ] - } - } - }, - { - "node": { - "afi": { "value": "evpn" }, - "safi": { "value": "unicast" }, - "vrf": { "node": null }, - "active_peer_groups": { - "edges": [ - { "node": { "name": { "value": "evpn" } } } - ] - }, - "active_sessions": { "edges": [] }, - "networks": { "edges": [] } - } - } - ] - } - } -} diff --git a/infrahub/transforms/tests/bgp_yang/leaf1/output.json b/infrahub/transforms/tests/bgp_yang/leaf1/output.json deleted file mode 100644 index 1be13e7..0000000 --- a/infrahub/transforms/tests/bgp_yang/leaf1/output.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "bgp": { - "global": { - "asn": 65001, - "router_id": "10.0.250.11", - "default_ipv4_unicast": false, - "log_neighbor_changes": true, - "distance": { - "ebgp": 20, - "ibgp": 200, - "local": 200 - }, - "ecmp": { - "max_paths": 4, - "max_ecmp": 64 - } - }, - "peer_groups": [ - { - "name": "underlay", - "type": "underlay", - "remote_asn": 65000, - "update_source": null, - "ebgp_multihop": null, - "send_community": null, - "next_hop_self": false, - "next_hop_unchanged": false, - "maximum_routes": 12000, - "maximum_routes_warning_only": true - }, - { - "name": "underlay_ibgp", - "type": "underlay_ibgp", - "remote_asn": 65001, - "update_source": null, - "ebgp_multihop": null, - "send_community": null, - "next_hop_self": true, - "next_hop_unchanged": false, - "maximum_routes": 12000, - "maximum_routes_warning_only": true - }, - { - "name": "evpn", - "type": "evpn", - "remote_asn": 65000, - "update_source": "Loopback0", - "ebgp_multihop": 3, - "send_community": "extended", - "next_hop_self": false, - "next_hop_unchanged": false, - "maximum_routes": 12000, - "maximum_routes_warning_only": true - } - ], - "neighbors": [ - { - "peer_address": "10.0.1.0", - "description": "underlay to spine1", - "enabled": true, - "peer_group": "underlay", - "remote_asn": null - }, - { - "peer_address": "10.0.2.0", - "description": "underlay to spine2", - "enabled": true, - "peer_group": "underlay", - "remote_asn": null - }, - { - "peer_address": "10.0.3.1", - "description": "iBGP to leaf2", - "enabled": true, - "peer_group": "underlay_ibgp", - "remote_asn": null - }, - { - "peer_address": "10.0.250.1", - "description": "EVPN to spine1", - "enabled": true, - "peer_group": "evpn", - "remote_asn": null - }, - { - "peer_address": "10.0.250.2", - "description": "EVPN to spine2", - "enabled": true, - "peer_group": "evpn", - "remote_asn": null - } - ], - "address_families": [ - { - "afi": "ipv4", - "safi": "unicast", - "active_peer_groups": [ - "underlay", - "underlay_ibgp" - ], - "active_sessions": [], - "networks": [ - "10.0.250.11/32", - "10.0.255.11/32" - ] - }, - { - "afi": "evpn", - "safi": "unicast", - "active_peer_groups": [ - "evpn" - ], - "active_sessions": [], - "networks": [] - } - ], - "vrf_neighbors": [], - "vrf_address_families": [] - } -} diff --git a/infrahub/transforms/tests/bgp_yang/leaf7/input.json b/infrahub/transforms/tests/bgp_yang/leaf7/input.json deleted file mode 100644 index 870bf8f..0000000 --- a/infrahub/transforms/tests/bgp_yang/leaf7/input.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "data": { - "InfraBGPRouterConfig": { - "edges": [ - { - "node": { - "router_id": { "value": "10.0.250.17" }, - "default_ipv4_unicast": { "value": false }, - "log_neighbor_changes": { "value": true }, - "ecmp_max_paths": { "value": 4 }, - "ecmp_max_ecmp": { "value": 64 }, - "ebgp_distance": { "value": 20 }, - "ibgp_distance": { "value": 200 }, - "local_distance": { "value": 200 }, - "local_asn": { - "node": { - "asn": { "value": 65004 } - } - }, - "peer_groups": { - "edges": [ - { - "node": { - "name": { "value": "underlay" }, - "peer_group_type": { "value": "underlay" }, - "update_source": { "value": null }, - "ebgp_multihop": { "value": null }, - "send_community": { "value": "none" }, - "next_hop_self": { "value": false }, - "next_hop_unchanged": { "value": false }, - "maximum_routes": { "value": 12000 }, - "maximum_routes_warning_only": { "value": true }, - "remote_asn": { - "node": { - "asn": { "value": 65000 } - } - } - } - }, - { - "node": { - "name": { "value": "underlay_ibgp" }, - "peer_group_type": { "value": "underlay_ibgp" }, - "update_source": { "value": null }, - "ebgp_multihop": { "value": null }, - "send_community": { "value": "none" }, - "next_hop_self": { "value": true }, - "next_hop_unchanged": { "value": false }, - "maximum_routes": { "value": 12000 }, - "maximum_routes_warning_only": { "value": true }, - "remote_asn": { - "node": { - "asn": { "value": 65004 } - } - } - } - }, - { - "node": { - "name": { "value": "evpn" }, - "peer_group_type": { "value": "evpn" }, - "update_source": { "value": "Loopback0" }, - "ebgp_multihop": { "value": 3 }, - "send_community": { "value": "extended" }, - "next_hop_self": { "value": false }, - "next_hop_unchanged": { "value": false }, - "maximum_routes": { "value": 12000 }, - "maximum_routes_warning_only": { "value": true }, - "remote_asn": { - "node": { - "asn": { "value": 65000 } - } - } - } - } - ] - }, - "sessions": { - "edges": [ - { - "node": { - "peer_address": { "value": "10.0.1.12" }, - "description": { "value": "underlay to spine1" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "underlay" }, "local_identifier": { "value": "leaf7__underlay" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine1" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.2.12" }, - "description": { "value": "underlay to spine2" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "underlay" }, "local_identifier": { "value": "leaf7__underlay" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine2" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.3.7" }, - "description": { "value": "iBGP to leaf8" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "underlay_ibgp" }, "local_identifier": { "value": "leaf7__underlay_ibgp" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf8" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.1" }, - "description": { "value": "EVPN to spine1" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "leaf7__evpn" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine1" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.2" }, - "description": { "value": "EVPN to spine2" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "leaf7__evpn" } } }, - "remote_asn": { "node": null }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "spine2" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.90.90.1" }, - "description": { "value": "border peering to AS 64999 in VRF gold" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 64999 } } }, - "vrf": { "node": { "name": { "value": "gold" } } }, - "peer_device": { "node": null } - } - } - ] - } - } - } - ] - }, - "InfraBGPAddressFamily": { - "edges": [ - { - "node": { - "afi": { "value": "ipv4" }, - "safi": { "value": "unicast" }, - "vrf": { "node": null }, - "active_peer_groups": { - "edges": [ - { "node": { "name": { "value": "underlay" } } }, - { "node": { "name": { "value": "underlay_ibgp" } } } - ] - }, - "active_sessions": { "edges": [] }, - "networks": { - "edges": [ - { "node": { "address": { "value": "10.0.250.17/32" } } }, - { "node": { "address": { "value": "10.0.255.14/32" } } } - ] - } - } - }, - { - "node": { - "afi": { "value": "evpn" }, - "safi": { "value": "unicast" }, - "vrf": { "node": null }, - "active_peer_groups": { - "edges": [ - { "node": { "name": { "value": "evpn" } } } - ] - }, - "active_sessions": { "edges": [] }, - "networks": { "edges": [] } - } - }, - { - "node": { - "afi": { "value": "ipv4" }, - "safi": { "value": "unicast" }, - "vrf": { "node": { "name": { "value": "gold" } } }, - "active_peer_groups": { "edges": [] }, - "active_sessions": { - "edges": [ - { "node": { "peer_address": { "value": "10.90.90.1" } } } - ] - }, - "networks": { "edges": [] } - } - } - ] - } - } -} diff --git a/infrahub/transforms/tests/bgp_yang/leaf7/output.json b/infrahub/transforms/tests/bgp_yang/leaf7/output.json deleted file mode 100644 index 51be6fe..0000000 --- a/infrahub/transforms/tests/bgp_yang/leaf7/output.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "bgp": { - "global": { - "asn": 65004, - "router_id": "10.0.250.17", - "default_ipv4_unicast": false, - "log_neighbor_changes": true, - "distance": { - "ebgp": 20, - "ibgp": 200, - "local": 200 - }, - "ecmp": { - "max_paths": 4, - "max_ecmp": 64 - } - }, - "peer_groups": [ - { - "name": "underlay", - "type": "underlay", - "remote_asn": 65000, - "update_source": null, - "ebgp_multihop": null, - "send_community": null, - "next_hop_self": false, - "next_hop_unchanged": false, - "maximum_routes": 12000, - "maximum_routes_warning_only": true - }, - { - "name": "underlay_ibgp", - "type": "underlay_ibgp", - "remote_asn": 65004, - "update_source": null, - "ebgp_multihop": null, - "send_community": null, - "next_hop_self": true, - "next_hop_unchanged": false, - "maximum_routes": 12000, - "maximum_routes_warning_only": true - }, - { - "name": "evpn", - "type": "evpn", - "remote_asn": 65000, - "update_source": "Loopback0", - "ebgp_multihop": 3, - "send_community": "extended", - "next_hop_self": false, - "next_hop_unchanged": false, - "maximum_routes": 12000, - "maximum_routes_warning_only": true - } - ], - "neighbors": [ - { - "peer_address": "10.0.1.12", - "description": "underlay to spine1", - "enabled": true, - "peer_group": "underlay", - "remote_asn": null - }, - { - "peer_address": "10.0.2.12", - "description": "underlay to spine2", - "enabled": true, - "peer_group": "underlay", - "remote_asn": null - }, - { - "peer_address": "10.0.3.7", - "description": "iBGP to leaf8", - "enabled": true, - "peer_group": "underlay_ibgp", - "remote_asn": null - }, - { - "peer_address": "10.0.250.1", - "description": "EVPN to spine1", - "enabled": true, - "peer_group": "evpn", - "remote_asn": null - }, - { - "peer_address": "10.0.250.2", - "description": "EVPN to spine2", - "enabled": true, - "peer_group": "evpn", - "remote_asn": null - } - ], - "address_families": [ - { - "afi": "ipv4", - "safi": "unicast", - "active_peer_groups": [ - "underlay", - "underlay_ibgp" - ], - "active_sessions": [], - "networks": [ - "10.0.250.17/32", - "10.0.255.14/32" - ] - }, - { - "afi": "evpn", - "safi": "unicast", - "active_peer_groups": [ - "evpn" - ], - "active_sessions": [], - "networks": [] - } - ], - "vrf_neighbors": [ - { - "peer_address": "10.90.90.1", - "description": "border peering to AS 64999 in VRF gold", - "enabled": true, - "peer_group": null, - "remote_asn": 64999, - "vrf": "gold" - } - ], - "vrf_address_families": [ - { - "afi": "ipv4", - "safi": "unicast", - "vrf": "gold", - "active_peer_groups": [], - "active_sessions": [ - "10.90.90.1" - ], - "networks": [] - } - ] - } -} diff --git a/infrahub/transforms/tests/bgp_yang/spine1/input.json b/infrahub/transforms/tests/bgp_yang/spine1/input.json deleted file mode 100644 index 7749078..0000000 --- a/infrahub/transforms/tests/bgp_yang/spine1/input.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "data": { - "InfraBGPRouterConfig": { - "edges": [ - { - "node": { - "router_id": { "value": "10.0.250.1" }, - "default_ipv4_unicast": { "value": false }, - "log_neighbor_changes": { "value": true }, - "ecmp_max_paths": { "value": 4 }, - "ecmp_max_ecmp": { "value": 64 }, - "ebgp_distance": { "value": 20 }, - "ibgp_distance": { "value": 200 }, - "local_distance": { "value": 200 }, - "local_asn": { - "node": { - "asn": { "value": 65000 } - } - }, - "peer_groups": { - "edges": [ - { - "node": { - "name": { "value": "evpn" }, - "peer_group_type": { "value": "evpn" }, - "update_source": { "value": "Loopback0" }, - "ebgp_multihop": { "value": 3 }, - "send_community": { "value": "extended" }, - "next_hop_self": { "value": false }, - "next_hop_unchanged": { "value": true }, - "maximum_routes": { "value": 12000 }, - "maximum_routes_warning_only": { "value": true }, - "remote_asn": { "node": null } - } - } - ] - }, - "sessions": { - "edges": [ - { - "node": { - "peer_address": { "value": "10.0.1.1" }, - "description": { "value": "underlay to leaf1" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65001 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf1" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.1.3" }, - "description": { "value": "underlay to leaf2" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65001 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf2" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.1.5" }, - "description": { "value": "underlay to leaf3" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65002 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf3" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.1.7" }, - "description": { "value": "underlay to leaf4" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65002 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf4" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.1.9" }, - "description": { "value": "underlay to leaf5" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65003 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf5" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.1.11" }, - "description": { "value": "underlay to leaf6" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65003 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf6" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.1.13" }, - "description": { "value": "underlay to leaf7" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65004 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf7" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.1.15" }, - "description": { "value": "underlay to leaf8" }, - "enabled": { "value": true }, - "peer_group": { "node": null }, - "remote_asn": { "node": { "asn": { "value": 65004 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf8" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.11" }, - "description": { "value": "EVPN to leaf1" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65001 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf1" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.12" }, - "description": { "value": "EVPN to leaf2" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65001 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf2" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.13" }, - "description": { "value": "EVPN to leaf3" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65002 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf3" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.14" }, - "description": { "value": "EVPN to leaf4" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65002 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf4" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.15" }, - "description": { "value": "EVPN to leaf5" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65003 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf5" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.16" }, - "description": { "value": "EVPN to leaf6" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65003 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf6" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.17" }, - "description": { "value": "EVPN to leaf7" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65004 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf7" } } } - } - }, - { - "node": { - "peer_address": { "value": "10.0.250.18" }, - "description": { "value": "EVPN to leaf8" }, - "enabled": { "value": true }, - "peer_group": { "node": { "name": { "value": "evpn" }, "local_identifier": { "value": "spine1__evpn" } } }, - "remote_asn": { "node": { "asn": { "value": 65004 } } }, - "vrf": { "node": null }, - "peer_device": { "node": { "name": { "value": "leaf8" } } } - } - } - ] - } - } - } - ] - }, - "InfraBGPAddressFamily": { - "edges": [ - { - "node": { - "afi": { "value": "ipv4" }, - "safi": { "value": "unicast" }, - "vrf": { "node": null }, - "active_peer_groups": { "edges": [] }, - "active_sessions": { - "edges": [ - { "node": { "peer_address": { "value": "10.0.1.1" } } }, - { "node": { "peer_address": { "value": "10.0.1.3" } } }, - { "node": { "peer_address": { "value": "10.0.1.5" } } }, - { "node": { "peer_address": { "value": "10.0.1.7" } } }, - { "node": { "peer_address": { "value": "10.0.1.9" } } }, - { "node": { "peer_address": { "value": "10.0.1.11" } } }, - { "node": { "peer_address": { "value": "10.0.1.13" } } }, - { "node": { "peer_address": { "value": "10.0.1.15" } } } - ] - }, - "networks": { - "edges": [ - { "node": { "address": { "value": "10.0.250.1/32" } } } - ] - } - } - }, - { - "node": { - "afi": { "value": "evpn" }, - "safi": { "value": "unicast" }, - "vrf": { "node": null }, - "active_peer_groups": { - "edges": [ - { "node": { "name": { "value": "evpn" } } } - ] - }, - "active_sessions": { "edges": [] }, - "networks": { "edges": [] } - } - } - ] - } - } -} diff --git a/infrahub/transforms/tests/bgp_yang/spine1/output.json b/infrahub/transforms/tests/bgp_yang/spine1/output.json deleted file mode 100644 index ebadf87..0000000 --- a/infrahub/transforms/tests/bgp_yang/spine1/output.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "bgp": { - "global": { - "asn": 65000, - "router_id": "10.0.250.1", - "default_ipv4_unicast": false, - "log_neighbor_changes": true, - "distance": { - "ebgp": 20, - "ibgp": 200, - "local": 200 - }, - "ecmp": { - "max_paths": 4, - "max_ecmp": 64 - } - }, - "peer_groups": [ - { - "name": "evpn", - "type": "evpn", - "remote_asn": null, - "update_source": "Loopback0", - "ebgp_multihop": 3, - "send_community": "extended", - "next_hop_self": false, - "next_hop_unchanged": true, - "maximum_routes": 12000, - "maximum_routes_warning_only": true - } - ], - "neighbors": [ - { - "peer_address": "10.0.1.1", - "description": "underlay to leaf1", - "enabled": true, - "peer_group": null, - "remote_asn": 65001 - }, - { - "peer_address": "10.0.1.3", - "description": "underlay to leaf2", - "enabled": true, - "peer_group": null, - "remote_asn": 65001 - }, - { - "peer_address": "10.0.1.5", - "description": "underlay to leaf3", - "enabled": true, - "peer_group": null, - "remote_asn": 65002 - }, - { - "peer_address": "10.0.1.7", - "description": "underlay to leaf4", - "enabled": true, - "peer_group": null, - "remote_asn": 65002 - }, - { - "peer_address": "10.0.1.9", - "description": "underlay to leaf5", - "enabled": true, - "peer_group": null, - "remote_asn": 65003 - }, - { - "peer_address": "10.0.1.11", - "description": "underlay to leaf6", - "enabled": true, - "peer_group": null, - "remote_asn": 65003 - }, - { - "peer_address": "10.0.1.13", - "description": "underlay to leaf7", - "enabled": true, - "peer_group": null, - "remote_asn": 65004 - }, - { - "peer_address": "10.0.1.15", - "description": "underlay to leaf8", - "enabled": true, - "peer_group": null, - "remote_asn": 65004 - }, - { - "peer_address": "10.0.250.11", - "description": "EVPN to leaf1", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65001 - }, - { - "peer_address": "10.0.250.12", - "description": "EVPN to leaf2", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65001 - }, - { - "peer_address": "10.0.250.13", - "description": "EVPN to leaf3", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65002 - }, - { - "peer_address": "10.0.250.14", - "description": "EVPN to leaf4", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65002 - }, - { - "peer_address": "10.0.250.15", - "description": "EVPN to leaf5", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65003 - }, - { - "peer_address": "10.0.250.16", - "description": "EVPN to leaf6", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65003 - }, - { - "peer_address": "10.0.250.17", - "description": "EVPN to leaf7", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65004 - }, - { - "peer_address": "10.0.250.18", - "description": "EVPN to leaf8", - "enabled": true, - "peer_group": "evpn", - "remote_asn": 65004 - } - ], - "address_families": [ - { - "afi": "ipv4", - "safi": "unicast", - "active_peer_groups": [], - "active_sessions": [ - "10.0.1.1", - "10.0.1.3", - "10.0.1.5", - "10.0.1.7", - "10.0.1.9", - "10.0.1.11", - "10.0.1.13", - "10.0.1.15" - ], - "networks": [ - "10.0.250.1/32" - ] - }, - { - "afi": "evpn", - "safi": "unicast", - "active_peer_groups": [ - "evpn" - ], - "active_sessions": [], - "networks": [] - } - ], - "vrf_neighbors": [], - "vrf_address_families": [] - } -} diff --git a/infrahub/transforms/tests/bgp_yang/test.yml b/infrahub/transforms/tests/bgp_yang/test.yml deleted file mode 100644 index e1d463e..0000000 --- a/infrahub/transforms/tests/bgp_yang/test.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -version: "1.0" -infrahub_tests: - - resource: Jinja2Transform - resource_name: bgp_yang_transform - tests: - - name: smoke_check - spec: - kind: jinja2-transform-smoke - - name: render_leaf1 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/bgp_yang/leaf1 - input: input.json - output: output.json - - name: render_spine1 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/bgp_yang/spine1 - input: input.json - output: output.json - - name: render_leaf7 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/bgp_yang/leaf7 - input: input.json - output: output.json diff --git a/infrahub/transforms/tests/interface_yang/input.json b/infrahub/transforms/tests/interface_yang/input.json deleted file mode 100644 index 8a94fe7..0000000 --- a/infrahub/transforms/tests/interface_yang/input.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "data": { - "InfraInterfaceLoopback": { - "edges": [ - { - "node": { - "name": { - "value": "Loopback0" - }, - "description": { - "value": "Router-ID" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": null - }, - "ip_addresses": { - "edges": [ - { - "node": { - "address": { - "value": "10.0.250.11/32" - } - } - } - ] - } - } - }, - { - "node": { - "name": { - "value": "Loopback1" - }, - "description": { - "value": "VTEP" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": null - }, - "ip_addresses": { - "edges": [] - } - } - } - ] - }, - "InfraInterfaceEthernet": { - "edges": [ - { - "node": { - "name": { - "value": "Ethernet1" - }, - "description": { - "value": "host1" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": null - }, - "speed": { - "value": null - }, - "mode": { - "value": "trunk" - }, - "lag": { - "node": { - "name": { - "value": "Port-Channel1" - } - } - }, - "ip_addresses": { - "edges": [] - } - } - }, - { - "node": { - "name": { - "value": "Ethernet10" - }, - "description": { - "value": "mlag peer link" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": null - }, - "speed": { - "value": null - }, - "mode": { - "value": "trunk" - }, - "lag": { - "node": { - "name": { - "value": "Port-Channel999" - } - } - }, - "ip_addresses": { - "edges": [] - } - } - }, - { - "node": { - "name": { - "value": "Ethernet11" - }, - "description": { - "value": "spine1" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": 9214 - }, - "speed": { - "value": null - }, - "mode": { - "value": "routed" - }, - "lag": null, - "ip_addresses": { - "edges": [ - { - "node": { - "address": { - "value": "10.0.1.1/31" - } - } - } - ] - } - } - }, - { - "node": { - "name": { - "value": "Ethernet12" - }, - "description": { - "value": "spine2" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": 9214 - }, - "speed": { - "value": null - }, - "mode": { - "value": "routed" - }, - "lag": null, - "ip_addresses": { - "edges": [ - { - "node": { - "address": { - "value": "10.0.2.1/31" - } - } - } - ] - } - } - } - ] - }, - "InfraInterfaceVlan": { - "edges": [ - { - "node": { - "name": { - "value": "Vlan4090" - }, - "description": { - "value": "MLAG Peer-Link" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": null - }, - "virtual_router_address": { - "value": null - }, - "autostate": { - "value": false - }, - "vlan": { - "node": { - "vlan_id": { - "value": 4090 - } - } - }, - "ip_addresses": { - "edges": [ - { - "node": { - "address": { - "value": "10.0.199.254/31" - } - } - } - ] - } - } - }, - { - "node": { - "name": { - "value": "Vlan4091" - }, - "description": { - "value": "MLAG iBGP Peering" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": 9214 - }, - "virtual_router_address": { - "value": null - }, - "autostate": { - "value": true - }, - "vlan": { - "node": { - "vlan_id": { - "value": 4091 - } - } - }, - "ip_addresses": { - "edges": [ - { - "node": { - "address": { - "value": "10.0.3.0/31" - } - } - } - ] - } - } - } - ] - }, - "InfraInterfaceLag": { - "edges": [ - { - "node": { - "name": { - "value": "Port-Channel1" - }, - "description": { - "value": "host1" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": null - }, - "lacp_mode": { - "value": "active" - }, - "mlag_id": { - "value": 1 - }, - "members": { - "edges": [ - { - "node": { - "name": { - "value": "Ethernet1" - } - } - } - ] - }, - "ip_addresses": { - "edges": [] - } - } - }, - { - "node": { - "name": { - "value": "Port-Channel999" - }, - "description": { - "value": "MLAG Peer" - }, - "enabled": { - "value": true - }, - "mtu": { - "value": null - }, - "lacp_mode": { - "value": "active" - }, - "mlag_id": { - "value": null - }, - "members": { - "edges": [ - { - "node": { - "name": { - "value": "Ethernet10" - } - } - } - ] - }, - "ip_addresses": { - "edges": [] - } - } - } - ] - } - } -} diff --git a/infrahub/transforms/tests/interface_yang/output.json b/infrahub/transforms/tests/interface_yang/output.json deleted file mode 100644 index c19e90d..0000000 --- a/infrahub/transforms/tests/interface_yang/output.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - {"description":"host1","enabled":true,"ip_addresses":[],"lag":"Port-Channel1","mode":"trunk","mtu":null,"name":"Ethernet1","speed":null,"type":"ethernet"}, - {"description":"mlag peer link","enabled":true,"ip_addresses":[],"lag":"Port-Channel999","mode":"trunk","mtu":null,"name":"Ethernet10","speed":null,"type":"ethernet"}, - {"description":"spine1","enabled":true,"ip_addresses":["10.0.1.1/31"],"lag":null,"mode":"routed","mtu":9214,"name":"Ethernet11","speed":null,"type":"ethernet"}, - {"description":"spine2","enabled":true,"ip_addresses":["10.0.2.1/31"],"lag":null,"mode":"routed","mtu":9214,"name":"Ethernet12","speed":null,"type":"ethernet"}, - {"description":"Router-ID","enabled":true,"ip_addresses":["10.0.250.11/32"],"mtu":null,"name":"Loopback0","type":"loopback"}, - {"description":"VTEP","enabled":true,"ip_addresses":[],"mtu":null,"name":"Loopback1","type":"loopback"}, - {"description":"host1","enabled":true,"ip_addresses":[],"lacp_mode":"active","members":["Ethernet1"],"mlag_id":1,"mtu":null,"name":"Port-Channel1","type":"lag"}, - {"description":"MLAG Peer","enabled":true,"ip_addresses":[],"lacp_mode":"active","members":["Ethernet10"],"mlag_id":null,"mtu":null,"name":"Port-Channel999","type":"lag"}, - {"autostate":false,"description":"MLAG Peer-Link","enabled":true,"ip_addresses":["10.0.199.254/31"],"mtu":null,"name":"Vlan4090","type":"vlan","virtual_router_address":null,"vlan_id":4090}, - {"autostate":true,"description":"MLAG iBGP Peering","enabled":true,"ip_addresses":["10.0.3.0/31"],"mtu":9214,"name":"Vlan4091","type":"vlan","virtual_router_address":null,"vlan_id":4091} -] diff --git a/infrahub/transforms/tests/interface_yang/test.yml b/infrahub/transforms/tests/interface_yang/test.yml deleted file mode 100644 index 82727c4..0000000 --- a/infrahub/transforms/tests/interface_yang/test.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -version: "1.0" -infrahub_tests: - - resource: Jinja2Transform - resource_name: interface_yang_transform - tests: - - name: smoke_check - spec: - kind: jinja2-transform-smoke - - name: render_leaf1 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/interface_yang - input: input.json - output: output.json diff --git a/infrahub/transforms/tests/mlag_yang/leaf1/input.json b/infrahub/transforms/tests/mlag_yang/leaf1/input.json deleted file mode 100644 index 35e1033..0000000 --- a/infrahub/transforms/tests/mlag_yang/leaf1/input.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "data": { - "InfraMlagPeerConfig": { - "edges": [ - { - "node": { - "local_interface_ip": { - "value": "10.0.199.254/31" - }, - "peer_address": { - "value": "10.0.199.255" - }, - "heartbeat_peer_ip": { - "value": "172.16.0.50" - }, - "device": { - "node": { - "name": { - "value": "leaf1" - } - } - }, - "mlag_domain": { - "node": { - "domain_id": { - "value": "leafs-1-2" - }, - "virtual_mac": { - "value": "c001.cafe.babe" - }, - "heartbeat_vrf": { - "value": "mgmt" - }, - "dual_primary_detection": { - "value": true - }, - "dual_primary_delay": { - "value": 10 - }, - "dual_primary_action": { - "value": "errdisable" - }, - "devices": { - "edges": [ - { - "node": { - "name": { - "value": "leaf1" - } - } - }, - { - "node": { - "name": { - "value": "leaf2" - } - } - } - ] - }, - "peer_vlan": { - "node": { - "vlan_id": { - "value": 4090 - } - } - }, - "ibgp_vlan": { - "node": { - "vlan_id": { - "value": 4091 - } - } - } - } - }, - "local_interface": { - "node": { - "name": { - "value": "Vlan4090" - } - } - }, - "peer_link": { - "node": { - "name": { - "value": "Port-Channel999" - } - } - } - } - } - ] - } - } -} diff --git a/infrahub/transforms/tests/mlag_yang/leaf1/output.json b/infrahub/transforms/tests/mlag_yang/leaf1/output.json deleted file mode 100644 index 3c30528..0000000 --- a/infrahub/transforms/tests/mlag_yang/leaf1/output.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "mlag": { - "config": { - "domain-id": "leafs-1-2", - "peer-link": "Port-Channel999", - "local-interface": "Vlan4090", - "peer-address": "10.0.199.255", - "shutdown": false - }, - "dual_primary_detection": { - "enabled": true, - "delay": 10, - "action": "errdisable", - "heartbeat_peer_ip": "172.16.0.50", - "heartbeat_vrf": "mgmt" - }, - "virtual_mac": "c001.cafe.babe", - "peer_vlan_id": 4090, - "ibgp_vlan_id": 4091, - "local_interface_ip": "10.0.199.254/31" - } -} diff --git a/infrahub/transforms/tests/mlag_yang/spine1/input.json b/infrahub/transforms/tests/mlag_yang/spine1/input.json deleted file mode 100644 index ec3d226..0000000 --- a/infrahub/transforms/tests/mlag_yang/spine1/input.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "InfraMlagPeerConfig": { - "edges": [] - } - } -} diff --git a/infrahub/transforms/tests/mlag_yang/spine1/output.json b/infrahub/transforms/tests/mlag_yang/spine1/output.json deleted file mode 100644 index fe51488..0000000 --- a/infrahub/transforms/tests/mlag_yang/spine1/output.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/infrahub/transforms/tests/mlag_yang/test.yml b/infrahub/transforms/tests/mlag_yang/test.yml deleted file mode 100644 index 359b43f..0000000 --- a/infrahub/transforms/tests/mlag_yang/test.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -version: "1.0" -infrahub_tests: - - resource: Jinja2Transform - resource_name: mlag_yang_transform - tests: - - name: smoke_check - spec: - kind: jinja2-transform-smoke - - name: render_leaf1 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/mlag_yang/leaf1 - input: input.json - output: output.json - - name: render_spine1 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/mlag_yang/spine1 - input: input.json - output: output.json diff --git a/infrahub/transforms/tests/vlan_yang/input.json b/infrahub/transforms/tests/vlan_yang/input.json deleted file mode 100644 index ed75a16..0000000 --- a/infrahub/transforms/tests/vlan_yang/input.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "data": { - "InfraVTEP": { - "edges": [ - { - "node": { - "source_address": { - "value": "10.0.255.11" - }, - "udp_port": { - "value": 4789 - }, - "vlan_vni_mappings": { - "edges": [ - { - "node": { - "vlan": { - "node": { - "vlan_id": { - "value": 40 - }, - "name": { - "value": "test-l2-vxlan" - }, - "status": { - "value": "active" - }, - "vlan_type": { - "value": "standard" - }, - "trunk_groups": { - "value": null - }, - "stp_enabled": { - "value": true - }, - "vni": { - "node": { - "vni": { - "value": 110040 - }, - "vni_type": { - "value": "l2vni" - } - } - } - } - } - } - } - ] - } - } - } - ] - }, - "InfraInterfaceVlan": { - "edges": [ - { - "node": { - "vlan": { - "node": { - "vlan_id": { - "value": 4090 - }, - "name": { - "value": "mlag-peer" - }, - "status": { - "value": "active" - }, - "vlan_type": { - "value": "mlag_peer" - }, - "trunk_groups": { - "value": ["mlag-peer"] - }, - "stp_enabled": { - "value": false - }, - "vni": null - } - } - } - }, - { - "node": { - "vlan": { - "node": { - "vlan_id": { - "value": 4091 - }, - "name": { - "value": "mlag-ibgp" - }, - "status": { - "value": "active" - }, - "vlan_type": { - "value": "mlag_ibgp" - }, - "trunk_groups": { - "value": ["mlag-peer"] - }, - "stp_enabled": { - "value": false - }, - "vni": null - } - } - } - } - ] - } - } -} diff --git a/infrahub/transforms/tests/vlan_yang/output.json b/infrahub/transforms/tests/vlan_yang/output.json deleted file mode 100644 index d97bbbb..0000000 --- a/infrahub/transforms/tests/vlan_yang/output.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "name": "test-l2-vxlan", - "status": "ACTIVE", - "stp_enabled": true, - "trunk_groups": null, - "vlan_id": 40, - "vlan_type": "standard", - "vni": 110040, - "vni_type": "l2vni" - }, - { - "name": "mlag-peer", - "status": "ACTIVE", - "stp_enabled": false, - "trunk_groups": ["mlag-peer"], - "vlan_id": 4090, - "vlan_type": "mlag_peer", - "vni": null, - "vni_type": null - }, - { - "name": "mlag-ibgp", - "status": "ACTIVE", - "stp_enabled": false, - "trunk_groups": ["mlag-peer"], - "vlan_id": 4091, - "vlan_type": "mlag_ibgp", - "vni": null, - "vni_type": null - } -] diff --git a/infrahub/transforms/tests/vlan_yang/test.yml b/infrahub/transforms/tests/vlan_yang/test.yml deleted file mode 100644 index f6ea77b..0000000 --- a/infrahub/transforms/tests/vlan_yang/test.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -version: "1.0" -infrahub_tests: - - resource: Jinja2Transform - resource_name: vlan_yang_transform - tests: - - name: smoke_check - spec: - kind: jinja2-transform-smoke - - name: render_leaf1 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/vlan_yang - input: input.json - output: output.json diff --git a/infrahub/transforms/tests/vrf_yang/input.json b/infrahub/transforms/tests/vrf_yang/input.json deleted file mode 100644 index f35d7bc..0000000 --- a/infrahub/transforms/tests/vrf_yang/input.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "data": { - "InfraVRFDeviceAssignment": { - "edges": [ - { - "node": { - "route_distinguisher": { - "value": "10.0.250.13:1" - }, - "vrf": { - "node": { - "name": { - "value": "gold" - }, - "description": { - "value": "VRF gold - L3 VXLAN with symmetric IRB" - }, - "route_distinguisher": { - "value": null - }, - "l3vni": { - "node": { - "vni": { - "value": 100001 - }, - "vni_type": { - "value": "l3vni" - } - } - }, - "import_targets": { - "edges": [ - { - "node": { - "target": { - "value": "1:100001" - } - } - } - ] - }, - "export_targets": { - "edges": [ - { - "node": { - "target": { - "value": "1:100001" - } - } - } - ] - } - } - }, - "import_targets": { - "edges": [ - { - "node": { - "target": { - "value": "1:100001" - } - } - } - ] - }, - "export_targets": { - "edges": [ - { - "node": { - "target": { - "value": "1:100001" - } - } - } - ] - } - } - } - ] - } - } -} diff --git a/infrahub/transforms/tests/vrf_yang/output.json b/infrahub/transforms/tests/vrf_yang/output.json deleted file mode 100644 index ddefca1..0000000 --- a/infrahub/transforms/tests/vrf_yang/output.json +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "description": "VRF gold - L3 VXLAN with symmetric IRB", - "export_targets": [ - "1:100001" - ], - "import_targets": [ - "1:100001" - ], - "l3vni": 100001, - "redistribute_connected": true, - "route_distinguisher": "10.0.250.13:1", - "vrf_name": "gold" - } -] diff --git a/infrahub/transforms/tests/vrf_yang/test.yml b/infrahub/transforms/tests/vrf_yang/test.yml deleted file mode 100644 index 9e41098..0000000 --- a/infrahub/transforms/tests/vrf_yang/test.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -version: "1.0" -infrahub_tests: - - resource: Jinja2Transform - resource_name: vrf_yang_transform - tests: - - name: smoke_check - spec: - kind: jinja2-transform-smoke - - name: render_leaf3 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/vrf_yang - input: input.json - output: output.json diff --git a/infrahub/transforms/tests/vxlan_yang/input.json b/infrahub/transforms/tests/vxlan_yang/input.json deleted file mode 100644 index 40a35b2..0000000 --- a/infrahub/transforms/tests/vxlan_yang/input.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "data": { - "InfraVTEP": { - "edges": [ - { - "node": { - "source_address": { - "value": "10.0.255.11/32" - }, - "udp_port": { - "value": 4789 - }, - "learn_restrict": { - "value": "any" - }, - "source_interface": { - "node": { - "name": { - "value": "Loopback1" - } - } - }, - "vlan_vni_mappings": { - "edges": [ - { - "node": { - "description": { - "value": "VLAN 40 <-> VNI 110040" - }, - "vlan": { - "node": { - "vlan_id": { - "value": 40 - }, - "name": { - "value": "test-l2-vxlan" - } - } - }, - "vni": { - "node": { - "vni": { - "value": 110040 - }, - "vni_type": { - "value": "l2vni" - } - } - } - } - } - ] - } - } - } - ] - }, - "InfraVRFDeviceAssignment": { - "edges": [] - } - } -} diff --git a/infrahub/transforms/tests/vxlan_yang/output.json b/infrahub/transforms/tests/vxlan_yang/output.json deleted file mode 100644 index 906e00e..0000000 --- a/infrahub/transforms/tests/vxlan_yang/output.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "vtep": { - "learn_restrict": "any", - "source_address": "10.0.255.11/32", - "source_interface": "Loopback1", - "udp_port": 4789, - "vlan_vni_mappings": [ - {"vlan_id": 40, "vlan_name": "test-l2-vxlan", "vni": 110040, "vni_type": "l2vni"} - ], - "vrf_vni_mappings": [] - } -} diff --git a/infrahub/transforms/tests/vxlan_yang/test.yml b/infrahub/transforms/tests/vxlan_yang/test.yml deleted file mode 100644 index 519f926..0000000 --- a/infrahub/transforms/tests/vxlan_yang/test.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -version: "1.0" -infrahub_tests: - - resource: Jinja2Transform - resource_name: vxlan_yang_transform - tests: - - name: smoke_check - spec: - kind: jinja2-transform-smoke - - name: render_leaf1 - spec: - kind: jinja2-transform-unit-render - directory: infrahub/transforms/tests/vxlan_yang - input: input.json - output: output.json