From 7a6024b054151d3bb3a7bfb2e21e53fcc1e9c47d Mon Sep 17 00:00:00 2001 From: Menno Hamburg Date: Tue, 13 Jun 2023 23:04:32 +0200 Subject: [PATCH] Small improvements, where needed --- routeros/resource_routing_ospf_instance.go | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/routeros/resource_routing_ospf_instance.go b/routeros/resource_routing_ospf_instance.go index ef170723..bbbb03f6 100644 --- a/routeros/resource_routing_ospf_instance.go +++ b/routeros/resource_routing_ospf_instance.go @@ -62,10 +62,11 @@ func ResourceRoutingOspfInstance() *schema.Resource { Description: "the area used for MPLS traffic engineering.", }, "originate_default": { - Type: schema.TypeString, - Default: "never", - Optional: true, - Description: "Specifies default route (0.0.0.0/0) distribution method.", + Type: schema.TypeString, + Default: "never", + Optional: true, + Description: "Specifies default route (0.0.0.0/0) distribution method.", + ValidateFunc: validation.StringInSlice([]string{"always", "if-installed", "never"}, true), }, "out_filter_chain": { Type: schema.TypeString, @@ -78,9 +79,13 @@ func ResourceRoutingOspfInstance() *schema.Resource { Description: "name of the routing filter select chain, used for output selection.", }, "redistribute": { - Type: schema.TypeString, + Type: schema.TypeList, Optional: true, Description: "Enable redistribution of specific route types.", + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"bgp", "connected", "copy", "dhcp", "fantasy", "modem", "ospf", "rip", "static", "vpn"}, true), + }, }, "router_id": { Type: schema.TypeString, @@ -100,12 +105,13 @@ func ResourceRoutingOspfInstance() *schema.Resource { Type: schema.TypeString, Default: "main", Optional: true, - Description: "the VRF table this OSPF instance operates on", + Description: "The VRF table this OSPF instance operates on", }, "use_dn": { - Type: schema.TypeString, - Optional: true, - Description: "", + Type: schema.TypeString, + Optional: true, + Description: "Forces to use or ignore DN bit. Useful in some CE PE scenarios to inject intra-area routes into VRF. " + + "If a parameter is unset then the DN bit is used according to RFC. Available since v6rc12.", ValidateFunc: validation.StringInSlice([]string{"yes", "no"}, true), }, }