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>
This commit is contained in:
15
infrahub/transforms/tests/vrf_yang/output.json
Normal file
15
infrahub/transforms/tests/vrf_yang/output.json
Normal file
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user