From bef07c9683e3b24fcb52f511d28713844ab28aa3 Mon Sep 17 00:00:00 2001 From: Cameron Schaeffer Date: Thu, 20 Nov 2025 15:52:40 +0000 Subject: [PATCH] feat: Add IP multicast multipath Terraform module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Terraform module support for IP multicast multipath configuration, enabling automated deployment of multicast load balancing across multiple devices with device-specific and global defaults. Changes: - iosxe_multicast.tf: Create new multicast resource module - Multi-device support with for_each pattern - Configuration hierarchy: device-specific → global defaults → null - Global multicast multipath configuration support - VRF-specific multicast settings with nested for loop - Dependency on iosxe_vrf.vrf resource - README.md: Auto-generated documentation via terraform-docs - Added multicast resource to resources table - Alphabetically ordered between MSDP and NAT Module Features: - Supports multipath boolean flag - Supports s-g-hash algorithm selection (basic, next-hop-based) - Supports VRF-specific multipath configurations - Follows try() hierarchy pattern for configuration fallback - Handles empty VRF lists gracefully This completes Phase 2 (Terraform Module Development) for the multicast multipath feature. Related implementations: - Provider: terraform-provider-iosxe/iosxe_multicast - Schema: nac-iosxe/schemas/schema.yaml (multicast section) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 1 + iosxe_multicast.tf | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 iosxe_multicast.tf diff --git a/README.md b/README.md index 94121fa..86df872 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ module "iosxe" { | [iosxe_logging.logging](https://registry.terraform.io/providers/CiscoDevNet/iosxe/0.10.2/docs/resources/logging) | resource | | [iosxe_mdt_subscription.mdt_subscription](https://registry.terraform.io/providers/CiscoDevNet/iosxe/0.10.2/docs/resources/mdt_subscription) | resource | | [iosxe_msdp.msdp](https://registry.terraform.io/providers/CiscoDevNet/iosxe/0.10.2/docs/resources/msdp) | resource | +| [iosxe_multicast.multicast](https://registry.terraform.io/providers/CiscoDevNet/iosxe/0.10.2/docs/resources/multicast) | resource | | [iosxe_nat.nat](https://registry.terraform.io/providers/CiscoDevNet/iosxe/0.10.2/docs/resources/nat) | resource | | [iosxe_ntp.ntp](https://registry.terraform.io/providers/CiscoDevNet/iosxe/0.10.2/docs/resources/ntp) | resource | | [iosxe_ospf.ospf](https://registry.terraform.io/providers/CiscoDevNet/iosxe/0.10.2/docs/resources/ospf) | resource | diff --git a/iosxe_multicast.tf b/iosxe_multicast.tf new file mode 100644 index 0000000..0f887e5 --- /dev/null +++ b/iosxe_multicast.tf @@ -0,0 +1,17 @@ +resource "iosxe_multicast" "multicast" { + for_each = { for device in local.devices : device.name => device if try(local.device_config[device.name].multicast, null) != null || try(local.defaults.iosxe.configuration.multicast, null) != null } + device = each.value.name + + multipath = try(local.device_config[each.value.name].multicast.multipath, local.defaults.iosxe.configuration.multicast.multipath, null) + multipath_s_g_hash = try(local.device_config[each.value.name].multicast.multipath_s_g_hash, local.defaults.iosxe.configuration.multicast.multipath_s_g_hash, null) + + vrfs = try(length(local.device_config[each.value.name].multicast.vrfs) == 0, true) ? null : [for vrf in local.device_config[each.value.name].multicast.vrfs : { + vrf = try(vrf.vrf, null) + multipath = try(vrf.multipath, local.defaults.iosxe.configuration.multicast.vrfs.multipath, null) + multipath_s_g_hash = try(vrf.multipath_s_g_hash, local.defaults.iosxe.configuration.multicast.vrfs.multipath_s_g_hash, null) + }] + + depends_on = [ + iosxe_vrf.vrf + ] +}