Commit Graph
13 Commits
Author SHA1 Message Date
DamienandClaude Sonnet 4.6 6df4e5ab19 feat: Add Infrahub Jinja2 transform for BGP configuration (#23)
Single unified bgp_yang_transform covering the full BGP router stanza
(process config, peer groups, neighbors, address families) for all
10 fabric devices in a single query+template pass.

- Add GraphQL query bgp_intent.gql: queries InfraBGPRouterConfig by
  device name, traversing local_asn, peer_groups (with remote_asn),
  and sessions (with peer_group, remote_asn, vrf, peer_device);
  separately queries InfraBGPAddressFamily for the same device,
  including active_peer_groups, active_sessions, networks, and optional
  vrf relationship
- Add Jinja2 template bgp_yang.j2: renders a JSON object with bgp.global
  (ASN, router-id, distances, ECMP), bgp.peer_groups, bgp.neighbors,
  bgp.address_families for global sessions, plus bgp.vrf_neighbors and
  bgp.vrf_address_families for VRF-scoped entries (e.g. leaf7 VRF gold
  border peering); returns [] for devices with no BGP config; all
  optional relationships guarded with 'is defined and is not none' checks;
  send_community "none" normalised to null in output
- Update .infrahub.yml: register bgp_intent query and bgp_yang_transform
- Add unit test fixtures for three representative devices:
    leaf1  — 3 peer-groups, 5 global neighbors, 2 global AFs
    spine1 — 1 peer-group (evpn/next-hop-unchanged), 16 neighbors
             (8 direct underlay with remote_asn, 8 EVPN via peer-group),
             IPv4 AF activates individual sessions
    leaf7  — leaf1 pattern + VRF gold border session (AS 64999) and
             VRF-scoped IPv4 unicast AF

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 12:41:08 +01:00
Damien ac1634b561 Add device roles to fabric links 2026-02-22 10:07:27 +01:00
DamienandClaude Sonnet 4.6 9a0b6dd1e6 feat(schema): add bidirectional relationship identifiers and fabric-device links
- LocationSite: add devices (device__site) and fabrics (fabric__sites) reverse relationships
- InfraDevice.site: add identifier device__site
- InfraDevice: add fabric relationship (fabric__devices)
- InfraFabric.sites: add identifier fabric__sites; add devices reverse relationship (fabric__devices)
- InfraInterfaceVlan.vlan: add identifier vlan__svi
- InfraVLAN: add svi_interfaces reverse relationship (vlan__svi)
- Add 14-fabric-links.yml to assign all 10 devices to the evpn-lab fabric

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 20:59:10 +01:00
Damien 2c1fccee5b Remove IP addresses from interfaces and add new IPAM links file 2026-02-21 18:08:53 +01:00
Damien e778fedf71 Add IP addresses to loopback and VLAN interfaces 2026-02-21 18:03:19 +01:00
Damien 4aecc544da Refactor interface references to use structured format
Refactored all interface references in IPAM configuration to use the
structured format with kind and data fields instead of simple lists.
This improves consistency and makes the configuration more maintainable.
2026-02-21 17:41:11 +01:00
Damien 807f3ce8a1 refactor(ipam): simplify interface references to compact array format
Replace verbose interface definitions using node/kind objects with
concise [device, interface] array notation across all IPAM address
entries. This reduces verbosity and improves readability of the
IP address assignments for loopbacks and P2P underlay links.
2026-02-21 16:13:31 +01:00
Damien e9dad132ea feat(ipam): add interface associations to IP addresses
Add interface node and kind to all IP address entries in the IPAM configuration file. This change enhances the IPAM configuration by explicitly associating each IP address with its corresponding interface, improving clarity and maintainability of the network configuration.

The changes include:
- Adding interface node and kind for all Router-ID Loopback0 addresses
- Adding interface node and kind for all VTEP Loopback1 addresses
- Adding interface node and kind for all spine and leaf P2P underlay addresses
- Maintaining consistent format across all IP address entries
2026-02-21 16:02:54 +01:00
Damien e353ef0a90 Update MLAG schema to use IPHost instead of IPNetwork for local
interface IP
2026-02-21 11:48:13 +01:00
Damien 6dd4cc96ef fix(InfraBGPSessionUpsert): changeing load order of objects 2026-02-21 10:02:17 +01:00
Damien 7cd0103d39 Update .gitignore 2026-02-20 18:42:27 +01:00
Damien 1b25c92965 build(infrahub): update file paths to match new directory structure
Refactor the .infrahub.yml configuration file to prefix all schema, menu, and object paths with the 'infrahub/' directory. This change aligns the configuration with the reorganized project structure where Infrahub resources have been moved into a dedicated subfolder.
2026-02-20 18:33:37 +01:00
Damien b042e13b38 fea(infrahub): Add infrahub configuration 2026-02-20 16:12:07 +01:00