[OSPF] Add Advanced OSPF Configuration Module Mapping #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
Fixes #509
Depends on CiscoDevNet/terraform-provider-iosxe#351
Depends on netascode/nac-iosxe#585
Changes
Router-Level OSPF Module Mapping (
iosxe_ospf.tf)Updated Local Blocks:
ospf_configurations_without_vrf- Added 17 new router-level attributes for non-VRF OSPFospf_configurations_with_vrf- Added 16 new router-level attributes for VRF OSPF (excludes fast-reroute)Resource Blocks Updated:
iosxe_ospf.ospf- Maps all 17 attributes for non-VRF configurationsiosxe_ospf_vrf.ospf_vrf- Maps 16 attributes for VRF configurations (fast-reroute excluded)Attributes Mapped:
Log Adjacency Changes:
NSF (Non-Stop Forwarding):
Max-Metric Router LSA (6 attributes):
Fast-Reroute (Non-VRF only):
Redistribute:
Interface-Level OSPF Module Mapping (
iosxe_interfaces.tf)Updated Local Block:
interfaces_ethernets- Addedospf_multi_area_idsmappingMapping Logic:
Resource Block Updated:
iosxe_interface_ospf.ethernet_ospf- Mapsmulti_area_idsattributeImplementation Patterns
try() Pattern for Optional Attributes
All new attributes use the
try()function with fallback to defaults:This allows:
nullif neither YAML nor defaults provide a valueList Handling
multi_area_idsuses list transformation:nullfor empty lists (cleaner terraform plan output)VRF Context Handling
ospf_configurations_without_vrf): Includes all 17 attributesospf_configurations_with_vrf): Excludesfast_reroute_per_prefix_enable_prefix_priorityRationale:
fast-rerouteis not available in VRF OSPF per YANG model (discovered during provider implementation).Testing
Full NAC Workflow Testing
Device Testing Details
Configuration Verified
Files Modified
iosxe_ospf.tf- Added 17 router-level attribute mappings (VRF and non-VRF)iosxe_interfaces.tf- Added 1 interface-level attribute mapping (multi-area)Dependencies
Provider Dependency:
This PR depends on CiscoDevNet/terraform-provider-iosxe#TBD being merged and released.
Schema Dependency:
This PR depends on netascode/nac-iosxe#TBD for schema validation.
PR Status:
This PR can be submitted as Ready for Review with the understanding that full testing requires both dependencies to be merged first.
Breaking Changes
None. All new attributes are optional with proper fallback handling.
Key Implementation Notes
VRF Limitation - Fast-Reroute
fast_reroute_per_prefix_enable_prefix_priorityis NOT included in VRF OSPF configurationsDefaults Handling
All attributes properly handle three-tier fallback:
null(provider will use IOS-XE defaults)Multi-Area Format
Multi-area accepts both formats per YANG union type:
multi_area_ids: [10, 20]multi_area_ids: ["10.0.0.1"]Documentation
Complete documentation available in
EPIC-510-ospf_advanced_support/:MODULE-IMPLEMENTATION.md- Detailed mapping documentationMODULE-PHASE-COMPLETE.md- Phase summarytest-epic510-nac.yaml- Example NAC configurationAdditional Notes
This PR adds Terraform module support for advanced OSPF configuration features, mapping NAC YAML schema attributes to provider resources for log-adjacency-changes, NSF, max-metric, fast-reroute, redistribute options, and multi-area configurations