From 6c9310d0cba93743a17eed74bd093c3677cc4f40 Mon Sep 17 00:00:00 2001 From: Vaerh Date: Sun, 23 Apr 2023 18:17:49 +0300 Subject: [PATCH] fix: Add `check_gateway` field to `routeros_ip_route` Fixes #186 --- routeros/resource_ip_route.go | 6 ++++++ routeros/resource_ip_route_test.go | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/routeros/resource_ip_route.go b/routeros/resource_ip_route.go index 61c27b29..66e63e41 100644 --- a/routeros/resource_ip_route.go +++ b/routeros/resource_ip_route.go @@ -22,6 +22,12 @@ func ResourceIPRoute() *schema.Resource { Default: false, Description: "It's a blackhole route.", }, + "check_gateway": { + Type: schema.TypeString, + Optional: true, + Description: "Currently used check-gateway option.", + ValidateFunc: validation.StringInSlice([]string{"arp", "bfd", "bfd-multihop", "none", "ping"}, false), + }, KeyComment: PropCommentRw, "dhcp": { Type: schema.TypeBool, diff --git a/routeros/resource_ip_route_test.go b/routeros/resource_ip_route_test.go index 3f4340f0..0a5f91cd 100644 --- a/routeros/resource_ip_route_test.go +++ b/routeros/resource_ip_route_test.go @@ -60,10 +60,11 @@ provider "routeros" { } resource "routeros_ip_route" "test_route" { - distance = 1 - dst_address = "10.0.0.0/24" - gateway = "192.168.103.1" - } + distance = 1 + dst_address = "10.0.0.0/24" + gateway = "192.168.103.1" + check_gateway = "bfd-multihop" +} ` }