-
Notifications
You must be signed in to change notification settings - Fork 49
[TRM] Add PIM Advanced Support in Terraform Module #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TRM] Add PIM Advanced Support in Terraform Module #99
Conversation
Extended the iosxe_pim resource with register-source configuration support for both
global and VRF-specific contexts, enabling PIM register message source interface
specification.
New Attributes (2 total):
- Global PIM configuration:
- register_source_loopback: Conditionally set based on register_source_interface_type
and register_source_interface_id with three-level fallback (device config → defaults → null)
- VRF PIM configuration (within vrfs list):
- register_source_loopback: Conditionally set based on VRF register_source_interface_type
and register_source_interface_id with three-level fallback (VRF config → defaults → null)
Implementation Details:
- For consistency, follows the same pattern as the existing bsr_candidate_loopback pattern
- Uses conditional logic: interface_type == "Loopback" ? interface_id : null
- Implements proper try() fallback chain for graceful degradation
- Maintains alignment and formatting with existing attributes
- Supports template variable substitution via schema validation
Pre-Commit Configuration:
- Updated .pre-commit-config.yaml to include terraform-docs hook for new PIM example
- Ensures documentation auto-generation for examples/pim/ directory
- Maintains consistency with existing example documentation workflow
CLI Commands Supported:
- ip pim register-source Loopback<number>
- ip pim vrf <vrf_name> register-source Loopback<number>
Note: SSM range configuration (ssm_range, ssm_default) was already supported for both
global and VRF contexts and has been verified as part of this enhancement.
Files Modified:
- iosxe_pim.tf
- .pre-commit-config.yaml
…e and SSM range Created a complete PIM example demonstrating advanced multicast configuration including register-source interface specification and SSM range configuration for both global and VRF-specific contexts. Example Features: - Global PIM register-source configuration using Loopback101 - VRF-specific PIM register-source configuration using Loopback201 - SSM range configuration with ACL references (global: "10", VRF: "20") - Auto-RP configuration (global and VRF-specific) - RP address configuration for rendezvous point setup - Complete prerequisite configuration (system multicast routing, VRF, interfaces) - PIM sparse-mode enabled on Loopback interfaces Configuration Demonstrates: - Proper dependency chain: System → VRF → Interfaces → PIM - Realistic multi-VRF multicast deployment scenario - Interface separation for global vs VRF register sources - Different SSM ACLs for traffic isolation between contexts - Production-ready configuration patterns CLI Commands Demonstrated: - ip multicast-routing - ip pim register-source Loopback101 - ip pim ssm range 10 - ip pim vrf MULTICAST_VRF register-source Loopback201 - ip pim vrf MULTICAST_VRF ssm range 20 Files Added: - examples/pim/ - examples/pim/pim.nac.yaml - examples/pim/main.tf - examples/pim/versions.tf - examples/pim/.terraform-docs.yml - examples/pim/README.md (auto-generated via 'pre-commit run --all-files') Benefits: - Provides clear reference implementation for PIM advanced features - Demonstrates best practices for multicast configuration - Shows proper VRF isolation for multicast traffic - Enables users to quickly adopt register-source optimization - Follows terraform-iosxe-nac-iosxe example conventions
Changed register_source_loopback to register_source_interface_loopback to match the terraform-provider-iosxe attribute name.
|
Hey Blake, I reviewed this PR and found a small issue - the provider attribute is named |
Per the module contribution guidelines, individual feature examples are not required. The examples/system directory serves as the general usage example for the module.
|
Also removed the |
Thank you for reviewing this Andrea (and for the fix!) -- I'll be sure to check for any mismatches in future contributions.
Apologies for the extra work, but thank you for making the changes. I'll review the guidelines and refrain from creating these files in the future.
|
This PR extends the Terraform module to support PIM advanced configuration.