Files
arista-evpn-vxlan-clab/.infrahub.yml
Damien 7b40c5fbe1 feat: Add Infrahub Jinja2 transform for VRF/L3VNI configuration (#21)
- Add GraphQL query vrf_intent.gql: queries InfraVRFDeviceAssignment by
  device name, returning device-specific RD, VRF attributes (name,
  description, l3vni), and both device-level and VRF-level import/export
  route targets for fallback logic
- Add Jinja2 template vrf_yang.j2: renders a JSON array of VRF config
  objects with RD fallback (device → VRF-level) and RT merge logic
  (device-level if present, otherwise VRF-level); all optional
  relationships guarded with 'is defined and is not none' checks
- Update .infrahub.yml: register vrf_intent query and vrf_yang_transform
- Add unit test fixtures for leaf3: input.json (mock GraphQL response)
  and output.json (expected rendered JSON array)

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

47 lines
1.6 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
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