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 + ] +}