prudhvitella / terraform-provider-infoblox

Infoblox plugin for Terraform
Mozilla Public License 2.0
41 stars 54 forks source link

infoblox_ip error #52

Open ivandal77 opened 5 years ago

ivandal77 commented 5 years ago

Dear, no way to get the next available IP from a network CIDR using resource "infoblox_ip" "ip" { cidr = "172.16.8.0/24" }

I get this error:

infoblox_ip.ip: Creating...
  cidr:      "" => "172.16.8.0/24"
  ipaddress: "" => "<computed>"

Error: Error applying plan:

1 error(s) occurred:

* infoblox_ip.ip: 1 error(s) occurred:

* infoblox_ip.ip: [ERROR] Empty response from client.Network().find. Is 172.16.8.0/24 a valid network?

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

but the network exist:

 curl -k -u admin:passwd -X GET "https://infoblox/wapi/v2.9.1/network?_return_as_object=1"
{
    "result": [
        {
            "_ref": "network/ZG5zLm5ldHdvcmskMTcyLjE2LjguMC8yNC8w:172.16.8.0/24/default", 
            "network": "172.16.8.0/24", 
            "network_view": "default"
        }
    ]

Using:

resource "infoblox_ip" "ipAddressFromRange" {
  ip_range = "172.16.8.5-172.16.8.10"
}

crashed terraform! See attachment crash.log for details. Thanks.

crash.log

dn1s commented 5 years ago

Did you check if your infoblox installation still supports api version 1.4.1? Since version 1.4.1 is hardcoded unfortunately.

ayan1983 commented 5 years ago

Hi , I am having the same issue. I am using Terraform v0.11.13.

ivandal77 commented 5 years ago

You can mark as solved, but the error was in the documentation: "host - (Required) The base url for the Infoblox REST API, but it can also be sourced from the INFOBLOX_HOST environment variable."

It means in my opinion

https://hostname.domain/wapi/v1.4.1

but the working url is:

https://hostname.domain

Please explain better in the doc, thanks.