Files
arista-evpn-vxlan-clab/.infrahub.yml
Damien 21e79e3536 feat: Add Infrahub Jinja2 transform for MLAG configuration (#22)
- Add GraphQL query mlag_intent.gql: queries InfraMlagPeerConfig by
  device name, returning local IP, peer address, heartbeat peer IP,
  MLAG domain (domain-id, virtual-mac, heartbeat VRF, dual-primary
  detection settings, peer/iBGP VLANs, peer devices), local interface
  SVI name, and peer-link LAG name
- Add Jinja2 template mlag_yang.j2: renders a JSON object targeting
  Arista-native YANG path /arista-mlag-augments:mlag/config; returns
  empty array [] for devices with no MLAG config (spines); all optional
  relationship accesses guarded with 'is defined and is not none' checks
- Update .infrahub.yml: register mlag_intent query and mlag_yang_transform
- Add unit test fixtures for leaf1 (full MLAG config) and spine1 (empty
  response → []) following jinja2-transform-unit-render format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 11:59:21 +01:00

53 lines
1.9 KiB
YAML

---
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-bgp-sessions.yml
- infrahub/objects/11-vrfs.yml
- infrahub/objects/12-mlag.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
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