Giter Club home page Giter Club logo

terraform-provider-infoblox's People

Contributors

dn1s avatar fmosti-aib avatar golint-fixer avatar jackbracken avatar jrandall avatar mifrost avatar prudhvitella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-infoblox's Issues

query multiple IPs in loop count

Hi,

is there a way to support count loop returning more than one next available IP ?
I am aware that Infoblox API supports it (&num=X) https://community.infoblox.com/t5/API-Integration/Get-Next-Available-IP-and-Reserve/td-p/8548

my problem, I want to ask for the next X available IPs and create an A record for all of them.
On the example below in my case count = 4, but what happens is that I get 4x the same IP, instead of unique 4 next available IPs.

resource "infoblox_ip" "tunnel_ips" {
count = "4"
cidr = "192.168.0.0/16"
}

resource "infoblox_record" "vpn_host_internal" {
count = "4"
value = "${element(infoblox_ip.tunnel_ips.*.ipaddress, count.index)}"
name = "test-{count.index +1}"
domain = "acme.com"
type = "A"
ttl = 3600
}

Getting empty response from client.Network

I am providing a cidr of "10.193.3.0/24" to the infoblox_ip resource and am getting the following:

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

I see in the code that you print this error after this:
if len(network) == 0

I am not positive what is going into the 'network' variable, but if it is my cidr I am very confused.

Can you help me?

PTR Resource Idempotent

Hi,
Great work on this provider! I hit an issue with the PTR resource though. It doesn't seem to be idempotent. Every-time I run terraform plan/apply it wants to make a change. It seems like it may be similar to this issue #37

Terraform v0.11.10
This terraform-provider-infoblox: https://github.com/prudhvitella/terraform-provider-infoblox/releases/download/pre-release/linux_amd64_terraform-provider-infoblox

For example, this code:

resource "infoblox_record_ptr" "ptr" {  
  ptrdname = "vm02.domain.local"  
  name     = "175.0.0.10.in-addr.arpa" 
  view     = "default"
 
}

will result in this change everytime:

~ infoblox_record_ptr.ptr
      name: "" => "175.0.0.10.in-addr.arpa"

Also, if I change from name to address value in the resource definition I get the following behavior.

resource "infoblox_record_ptr" "ptr" {
  ptrdname = "vm02.domain.local"
  address     = "10.0.0.175"
  view     = "default"
}

This results in:

-/+ infoblox_record_ptr.ptr (new resource required)
      id:       "record:ptr/ZG5zLmJpbmRfcHRyJC5fZGVmYXVsdC5hcnBhLmluLWFkZHIuMTAuMTE2LjQuNDQuYTF2aXRzYmxkcjAyLnEyZGMubG9jYWw:175.0.0.10.in-addr.arpa/default" => <computed> (forces new resource)
      address:  "" => "10.0.0.175" (forces new resource)
      ptrdname: "vm02.domain.local" => "vm02.domain.local"
      view:     "default" => "default"

Unable to update A records

Hello, when I attempt to update an A record, I get the following response. I built the provider with the latest source. Thanks for any help.

* infoblox_record_a.dev-cf41-test2-kafka1: error updating Infoblox A record: Error AdmConProtoError: Field is not allowed for update: view - Client.Ibap.Proto - Field is not allowed for update: view

Document the installation procedure

Hi,

Would it be possible to document the installation procedure?

I tried to put the released binary in ~/.terraform.d/plugins/linux_amd64/linux_amd64_terraform-provider-infoblox, but terraform complains it cannot fing it as a provider:

$ terraform init

Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...

Provider "infoblox" not available for installation.

A provider named "infoblox" could not be found in the official repository.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
    terraform.d/plugins/linux_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".

Any idea how to install the plugin properly?

infoblox_ip error

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

Adding a 'Host' record not an idempotent operation

Hello,

I'm using:

  • terraform-provider-infoblox pre-release
  • Terraform v0.10.8
  • Infoblox 8.2.1-359366

The issue I'm observing:

After a new Host record has just been created via a Terraform template, if I were to run terraform plan a second time a new set of changes is proposed.

Even after this extra change set has been applied, a subsequent terraform plan produces the same changes yet again:

$ terraform plan
...
...
Terraform will perform the following actions:

  ~ module.testmodule.infoblox_record_host.myhost
      ipv4addr.#:                    "2" => "1"
      ipv4addr.0.address:            "" => "10.10.10.10"
      ipv4addr.0.configure_for_dhcp: "" => "false"
      ipv4addr.0.mac:                "" => "fa:16:3e:44:69:2b"
      ipv4addr.1.address:            "10.10.10.10" => ""
      ipv4addr.1.configure_for_dhcp: "true" => "false"
      ipv4addr.1.host:               "myhost.example.com" => ""
      ipv4addr.1.mac:                "fa:16:3e:44:69:2b" => ""
      ipv6addr.#:                    "1" => "0"


Plan: 0 to add, 1 to change, 0 to destroy.


$ terraform apply
...
...
  ipv4addr.#:                    "2" => "1"
  ipv4addr.0.address:            "" => "10.10.10.10"
  ipv4addr.0.configure_for_dhcp: "" => "false"
  ipv4addr.0.mac:                "" => "fa:16:3e:44:69:2b"
  ipv4addr.1.address:            "10.10.10.10" => ""
  ipv4addr.1.configure_for_dhcp: "true" => "false"
  ipv4addr.1.host:               "myhost.example.com" => ""
  ipv4addr.1.mac:                "fa:16:3e:44:69:2b" => ""
  ipv6addr.#:                    "1" => "0"


$ terraform plan
...
...
Terraform will perform the following actions:

  ~ module.testmodule.infoblox_record_host.myhost
      ipv4addr.#:                    "2" => "1"
      ipv4addr.0.address:            "" => "10.10.10.10"
      ipv4addr.0.configure_for_dhcp: "" => "false"
      ipv4addr.0.mac:                "" => "fa:16:3e:44:69:2b"
      ipv4addr.1.address:            "10.10.10.10" => ""
      ipv4addr.1.configure_for_dhcp: "true" => "false"
      ipv4addr.1.host:               "myhost.example.com" => ""
      ipv4addr.1.mac:                "fa:16:3e:44:69:2b" => ""
      ipv6addr.#:                    "1" => "0"


Plan: 0 to add, 1 to change, 0 to destroy.

The template:

resource "infoblox_record_host" "myhost" {
  name = "${var.fqdn}"
  view = "${var.dnsview}"

  ipv4addr {
    address = "${var.ipv4}"
    mac = "${var.mac}"
    configure_for_dhcp = false
  }
}

NB: The number of IP addresses associated with the record is 1, whereas the plugin seems to detect 2 in ipv4addr.#.

Expected behavior

I expect adding a new host record to be an idempotent operation given that no further changes are made to the given template and/or the infoblox record itself.

Adding Host record not idempotent configure_for_dns always saved in state file as `false`

terraform plan

  # infoblox_record_host.host will be created
  + resource "infoblox_record_host" "host" {
      + configure_for_dns = true
      + id                = (known after apply)
      + name              = "REDACTED"
      + view              = "default"

      + ipv4addr {
          + address = (known after apply)
        }
    }

terraform apply

  # infoblox_record_host.host will be created
  + resource "infoblox_record_host" "host" {
      + configure_for_dns = true
      + id                = (known after apply)
      + name              = "REDACTED"
      + view              = "default"

      + ipv4addr {
          + address = (known after apply)
        }
    }

terraform plan

  # infoblox_record_host.host will be updated in-place
  ~ resource "infoblox_record_host" "host" {
        comment           = ""
      ~ configure_for_dns = false -> true
        id                = "record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5zdHRndHMuY2xvdWQubWxjMS5wMDEuc2Ft:REDACTED/default"
        name              = "REDACTED"
        ttl               = 0
        view              = "default"

      ~ ipv4addr {
            address            = "10.97.8.1"
            configure_for_dhcp = false
            mac                = ""
        }
    }

debugging this using Postman, it appears for some reason that configure_for_dns is not returned when getting Host Record by reference

GET https://grid:443/wapi/v2.9/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5zdHRndHMuY2xvdWQubWxjMS5wMDEuc2Ft:REDACTED/default
{
    "_ref": "record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5zdHRndHMuY2xvdWQubWxjMS5wMDEuc2Ft:REDACTED/default",
    "ipv4addrs": [
        {
            "_ref": "record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQuX2RlZmF1bHQuY29tLnN0dGd0cy5jbG91ZC5tbGMxLnAwMS5zYW0uMTAuOTcuOC4xLg:10.97.8.1/REDACTED/default",
            "configure_for_dhcp": false,
            "host": "REDACTED",
            "ipv4addr": "10.97.8.1"
        }
    ],
    "name": "REDACTED",
    "view": "default"
}

A simple fix could be to fix this line

// RecordHostObject defines the HOST record object's fields
type RecordHostObject struct {
...
	ConfigureForDNS bool           `json:"configure_for_dns"`
...
}

to

	ConfigureForDNS bool           `json:"configure_for_dns,omitempty"`

FindUnusedIPInRange does not respect exclusions

It looks like the underlying go Infoblox API does not support exclusions in the 'find by range' query so the exclusion list is not passed to the next available IP query.
https://github.com/prudhvitella/terraform-provider-infoblox/blob/master/infoblox/resource_infoblox_ip.go#L108

However there is no documentation that describes or states that the Exclusion list is ignored if you use the "ip_range" attribute. For example the value 10.0.10.10 will still be assigned using the following resource block.

resource "infoblox_ip" "test" {
   ip_range="10.0.10.10-10.0.10.14"
   exclude = ["10.0.10.10"] #Ignored
}`

infoblox_ip never runs during subsequent plans using the same cidr

I am just using the infoblox_ip resource to pull the next available ip in a given block but am not using a reserve_a/host/aaaa resource to reserve it. (I am running a go script to reserve the ip using an Infoblox Fixed Address).
When I do a subsequent plan the reserve_ip block only refreshes it's state and does not grab a new one. Is there any way to force it to rerun even though the IP isn't reserved within Terraform

invalid remote plugin...

Using both terraform 0.8.4 and 0.8.6 gives me:

Error configuring: 1 error(s) occurred:

  • Unrecognized remote plugin message: 2|unix|/var/folders/9k/gqp_92xx5ml9__33gkmw7wrj69yys9/T/tf-plugin282817430

This usually means that the plugin is either invalid or simply
needs to be recompiled to support the latest protocol.`

Issue Applying

Could you please assist with the below error ?

infoblox_ip.theIPAddress: Creating...
cidr: "" => "10.13.34.0/24"
ipaddress: "" => ""
Error applying plan:

1 error(s) occurred:

  • infoblox_ip.theIPAddress: 1 error(s) occurred:

  • infoblox_ip.theIPAddress: unexpected EOF

Tf then crashes

panic: runtime error: index out of range

Hi there

Im trying to use your porvider to get the next free ip from a network but I keep getting the error:

[DEBUG] plugin.terraform-provider-infoblox: panic: runtime error: index out of range

In the crash.log I see the API URL the providers tries to access.
If i manually acces the url via curl I get a valid reponse with unsed ip's.

Any idea what might be wrong?

Cheers
yodarx

Pre-released binaries are not statically compiled

Pre-released binaries are not statically compiled:

bash-4.4$ ldd terraform-provider-infoblox
 /lib64/ld-linux-x86-64.so.2 (0x7f2322dbf000)
 libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f2322dbf000)
 libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f2322dbf000)

If for the next release, you could adopt a dockerfile to build them statically, like I did for another terraform plugin:

https://github.com/zoobab/terraform-provider-ldap/commits/Dockerfile

I will make a PR with those tools...

Broken on V10

Broken on Terraform V10
Terraform v0.10.0
Incompatible API version with plugin. Plugin version: 2, Ours: 4

infoblox_record_host Doesn't Store Comment in the Statefile

When using the infoblox_record_host resource with a comment, the plan will always show the comment is being set from empty strings to whatever your comment is:

I changed some values:

  ~ infoblox_record_host.foo
      comment:        "" => "Some foo comment"

  ~ infoblox_record_host.bar
      comment:        "" => "Some bar comment"

When looking in the statefile, it's clear that the comment is not saved, even though it's saved in the actual infoblox record:

$ terragrunt state show infoblox_record_host.foo

id                            = record:host/ZG5zLmhvc3QkLjEuY29tLmVub3ZhLmZvby1tcGVzY2V0dG8tdGVzdC1mNTAx:foo-mpescetto-test-f501.enova.com/inside
comment                       =
configure_for_dns             = false
ipv4addr.#                    = 4
ipv4addr.0.address            = 10.1.1.22
ipv4addr.0.configure_for_dhcp = false
ipv4addr.0.mac                =
ipv4addr.1.address            = 10.1.2.22
ipv4addr.1.configure_for_dhcp = false
ipv4addr.1.mac                =
ipv4addr.2.address            = 10.1.2.23
ipv4addr.2.configure_for_dhcp = false
ipv4addr.2.mac                =
ipv4addr.3.address            = 10.7.1.23
ipv4addr.3.configure_for_dhcp = false
ipv4addr.3.mac                =
ipv6addr.#                    = 0
name                          = foo.test.com
ttl                           = 0
view                          = inside

terraform-provider-infoblox errors when records are deleted on infoblox out of band

I got the following error recently, after some A records were deleted from infoblox, but still existed in terraform state file:

Error refreshing state: 1 error(s) occurred:

* module.spark-master.infoblox_record.spark-master-dns: 1 error(s) occurred:

* module.spark-master.infoblox_record.spark-master-dns: infoblox_record.spark-master-dns: Couldn't find Infoblox A record: Error AdmConDataNotFoundError: Reference record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQudWsuYWMuc2FuZ2VyLmhnaSxzcGFyay0wMS1tYXN0ZXIsMTcyLjI3LjkxLjI1MQ:spark-01-master.hgi.sanger.ac.uk/internal not found - Client.Ibap.Data.NotFound - Reference record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQudWsuYWMuc2FuZ2VyLmhnaSxzcGFyay0wMS1tYXN0ZXIsMTcyLjI3LjkxLjI1MQ:spark-01-master.hgi.sanger.ac.uk/internal not found

The problem here is that the terraform plugin Read method returns an error when the resource does not exist (in this case from the line:

return fmt.Errorf("Couldn't find Infoblox A record: %s", err)
).

This is not what the Read method is supposed to do according to the docs, which state: "If the ID is updated to blank, this tells Terraform the resource no longer exists (maybe it was destroyed out of band). Just like the destroy callback, the Read function should gracefully handle this case." (from https://www.terraform.io/guides/writing-custom-terraform-providers.html#implementing-read).

These error handlers should identify the condition when the error actually means "record not found" and in that case call d.SetId("") and return nil rather than returning an error.

TTL and comments do not get set on A records

When I setup a new A record, the provider wants to set the comment and TTL again on the next apply. A second apply does not set the values.

My workaround for now is to not set TTL or comment. The comment is off less concern.

Add support for host and ptr records, as well as obtain next available IP from CIDR.

Hi,

just wanted to say that your infoblox provider worked great. I was able to get it running in a short amount of time, great ReadMe. I just moved into a coding role and have a need to extend the functionality to include Host and Ptr records as well as the ability to query infoblox for the next available IP based on the network CIDR block give in another provider. Would it be possible to work together to accomplish this?

Thanks,

Karlos

Infoblox version not supported

When I try to create a record in Infoblox using terraform, it shows error : Invalid reference: record:a/wapi/v1.4.1/record:a
The version of Infoblox wapi that we use is v2.1. But the version supported is wapi/v1.4.1.
When I tried to access the link https://10.26.77.230/wapi/v2.1/record:a via browser, it worked. The result came in the form of XML.
Is it possible to convert version from 2.1 to 1.4.1?

terraform panic

I seem to be getting a panic when I try to create an A record.

InfoBlox Appliance version: 7.3.4

terraform --version
Terraform v0.6.16

terraform-provider-infoblox pre-release tag

Here are some lines of logs that show when it panics:

2016/07/11 10:49:46 [DEBUG] terraform-provider-infoblox: 2016/07/11 10:49:46 POST /wapi/v1.4.1/record:a  payload: <PAYLOAD_REMOVED>
2016/07/11 10:49:46 [DEBUG] terraform-provider-infoblox: panic: runtime error: invalid memory address or nil pointer dereference
2016/07/11 10:49:46 [DEBUG] terraform-provider-infoblox: [signal 0xb code=0x1 addr=0x10 pc=0x532c12]

Incompatible API version with plugin.

Infoblox provider is working fine with Terraform 0.11.X versions. When I tried with terraform 0.12.X, I am facing Incompatible API version with plugin issue

Error: Failed to instantiate provider "infoblox" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]

Support view attribute for CNAME records

Currently, the view attribute seems only be supported for the A records (reading through the code; the readme is silent on that).

Please add the support of this attribute to the CNAME records as well.

Can't add PTR or HOST records

I'd like to add reverse DNS addresses for my A records.

The provider does not allow PTR records, nor does it allow HOST records which appears to be an infoblox-specific thing that will create the A record AND the PTR for reverse lookups.

Error type assertion panic

Hi, we are getting occasional 'panic: interface conversion: error is *errors.errorString, not infoblox.Error' which come from the type assertion err.(infoblox.Error).Code() in the handleReadError function in resource_infoblox_record.go

It seems to be trying to assert that an ordinary go error (from fmt.Errorf in this case) is an infoblox.Error

It would be possible to check for this using the type assertion test (t, ok := i.(T)) which should stop the panic. But would that be just covering up a problem elsewhere?

thanks, Sarah

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.