diff --git a/docs/resources/fixed_address.md b/docs/resources/fixed_address.md index 1ec1127..1e9368f 100644 --- a/docs/resources/fixed_address.md +++ b/docs/resources/fixed_address.md @@ -16,7 +16,7 @@ Manages configuration details for a fixed address in infoblox ```terraform resource "infoblox_fixed_address" "fixed-addr" { ip_address = "172.19.4.251" - name = "HSRP-A" + hostname = "HSRP-A" comment = "example fixed address" match_client = "RESERVED" restart_if_needed = true @@ -41,7 +41,7 @@ resource "infoblox_fixed_address" "fixed-addr" { ```terraform resource "infoblox_fixed_address" "fixed-addr" { cidr = "172.19.4.0/24" - name = "HSRP-A" + hostname = "HSRP-A" comment = "example fixed address" match_client = "RESERVED" restart_if_needed = true @@ -66,7 +66,7 @@ resource "infoblox_fixed_address" "fixed-addr" { ```terraform resource "infoblox_fixed_address" "fixed-addr" { range_function_string = "172.19.4.2-172.19.4.10" - name = "HSRP-A" + hostname = "HSRP-A" comment = "example fixed address" match_client = "RESERVED" restart_if_needed = true @@ -91,7 +91,7 @@ resource "infoblox_fixed_address" "fixed-addr" { ```terraform resource "infoblox_fixed_address" "fixed-addr" { ip_address = "172.19.4.251" - name = "HSRP-A" + hostname = "HSRP-A" comment = "example fixed address" mac = "12:34:56:78:9A:BC" match_client = "MAC_ADDRESS" diff --git a/go.mod b/go.mod index 2f2fbe9..1c16b71 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,6 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3 github.com/techBeck03/go-ipmath v0.0.8 - github.com/techBeck03/infoblox-go-sdk v1.0.0 + github.com/techBeck03/infoblox-go-sdk v1.0.1 github.com/tidwall/gjson v1.9.3 ) diff --git a/go.sum b/go.sum index 9b665f7..063e4a4 100644 --- a/go.sum +++ b/go.sum @@ -273,8 +273,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/techBeck03/go-ipmath v0.0.8 h1:U/z7bYt+92I/VpbJvpW48+hnPC0rOmvLuyEuiURNeWw= github.com/techBeck03/go-ipmath v0.0.8/go.mod h1:VugtTa3vBBdfSTeYQQov/NzzXt40R+LtuFr15KWUhpY= -github.com/techBeck03/infoblox-go-sdk v1.0.0 h1:q62/WhKLMCSJEQIg71fx/3PbdTIEgLJtXJnl+LcGvpk= -github.com/techBeck03/infoblox-go-sdk v1.0.0/go.mod h1:miTvClw8XenPYZ9psw+71AmtlPmY2Lu0EPLBWJ0JIQw= +github.com/techBeck03/infoblox-go-sdk v1.0.1 h1:Em+53efxhKUmB05+QbQHQdWJIpaljp7On+8K21ApekI= +github.com/techBeck03/infoblox-go-sdk v1.0.1/go.mod h1:miTvClw8XenPYZ9psw+71AmtlPmY2Lu0EPLBWJ0JIQw= github.com/tidwall/gjson v1.9.3 h1:hqzS9wAHMO+KVBBkLxYdkEeeFHuqr95GfClRLKlgK0E= github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= diff --git a/vendor/github.com/techBeck03/infoblox-go-sdk/range.go b/vendor/github.com/techBeck03/infoblox-go-sdk/range.go index 51171e8..e813d07 100644 --- a/vendor/github.com/techBeck03/infoblox-go-sdk/range.go +++ b/vendor/github.com/techBeck03/infoblox-go-sdk/range.go @@ -160,31 +160,31 @@ func (c *Client) CreateSequentialRange(rangeObject *Range, query AddressQuery) e err = c.CreateRange(rangeObject) if err != nil { - return err - } - - log.Println("Pausing for race condition checks") - time.Sleep(1 * time.Second) - - // Check for used addresses within range - usedAddresses, err := c.GetUsedAddressesWithinRange(AddressQuery{ - CIDR: query.CIDR, - StartAddress: rangeObject.StartAddress, - EndAddress: rangeObject.EndAddress, - FilterEmptyHostnames: newBool(true), - }) - if err != nil { - return err - } - if len((*usedAddresses)) > 0 { - log.Println("Found allocated addresses within newly created range. Deleting and Recreating.....") - retryCount++ - err := c.DeleteRange(rangeObject.Ref) + verified = false + } else { + log.Println("Pausing for race condition checks") + time.Sleep(1 * time.Second) + + // Check for used addresses within range + usedAddresses, err := c.GetUsedAddressesWithinRange(AddressQuery{ + CIDR: query.CIDR, + StartAddress: rangeObject.StartAddress, + EndAddress: rangeObject.EndAddress, + FilterEmptyHostnames: newBool(true), + }) if err != nil { return err } - } else { - verified = true + if len((*usedAddresses)) > 0 { + log.Println("Found allocated addresses within newly created range. Deleting and Recreating.....") + retryCount++ + err := c.DeleteRange(rangeObject.Ref) + if err != nil { + return err + } + } else { + verified = true + } } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 4cf02a4..2452b69 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -174,7 +174,7 @@ github.com/oklog/run # github.com/techBeck03/go-ipmath v0.0.8 ## explicit github.com/techBeck03/go-ipmath -# github.com/techBeck03/infoblox-go-sdk v1.0.0 +# github.com/techBeck03/infoblox-go-sdk v1.0.1 ## explicit github.com/techBeck03/infoblox-go-sdk # github.com/tidwall/gjson v1.9.3