Skip to content

Conversation

@tech-of-all-trades
Copy link
Contributor

This PR extends the Terraform module to support PIM advanced configuration.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants