When an a_record is generated, it adds the domain name twice.
a_record should be: dbserver-001.domain.com but its generated as dbserver-001.domain.com.domain.com
resource "infoblox_ip_allocation" "ip_allocation" {
count = "${var.vm_count}"
network_view_name = "default"
vm_name = "${var.hostname}-00${count.index + 1}"
cidr = "${var.cidr}"
enable_dns = true
tenant_id = "test"
}
resource "infoblox_ip_association" "ip_association" {
count = "${var.vm_count}"
network_view_name = "default"
vm_name = "${element(infoblox_ip_allocation.ip_allocation..vm_name, count.index)}"
cidr = "${var.cidr}"
mac_addr = "${element(vsphere_virtual_machine.vm..network_interface.0.mac_address, count.index)}"
ip_addr = "${infoblox_ip_allocation.ip_allocation..ip_addr[count.index]}"
vm_id = "${element(vsphere_virtual_machine.vm..id, count.index)}"
tenant_id = "test"
}
resource "infoblox_a_record" "record" {
count = "${var.vm_count}"
network_view_name = "default"
cidr = "${var.cidr}"
ip_addr = "${infoblox_ip_allocation.ip_allocation..ip_addr[count.index]}"
vm_name = "${element(infoblox_ip_allocation.ip_allocation..vm_name, count.index)}"
dns_view = "intern"
zone = "${var.domainname}"
tenant_id = "test"
vm_id = "${element(vsphere_virtual_machine.vm.*.id, count.index)}"
}
When an a_record is generated, it adds the domain name twice.
a_record should be: dbserver-001.domain.com but its generated as dbserver-001.domain.com.domain.com
resource "infoblox_ip_allocation" "ip_allocation" {
count = "${var.vm_count}"
network_view_name = "default"
vm_name = "${var.hostname}-00${count.index + 1}"
cidr = "${var.cidr}"
enable_dns = true
tenant_id = "test"
}
resource "infoblox_ip_association" "ip_association" {
count = "${var.vm_count}"
network_view_name = "default"
vm_name = "${element(infoblox_ip_allocation.ip_allocation..vm_name, count.index)}"
cidr = "${var.cidr}"
mac_addr = "${element(vsphere_virtual_machine.vm..network_interface.0.mac_address, count.index)}"
ip_addr = "${infoblox_ip_allocation.ip_allocation..ip_addr[count.index]}"
vm_id = "${element(vsphere_virtual_machine.vm..id, count.index)}"
tenant_id = "test"
}
resource "infoblox_a_record" "record" {
count = "${var.vm_count}"
network_view_name = "default"
cidr = "${var.cidr}"
ip_addr = "${infoblox_ip_allocation.ip_allocation..ip_addr[count.index]}"
vm_name = "${element(infoblox_ip_allocation.ip_allocation..vm_name, count.index)}"
dns_view = "intern"
zone = "${var.domainname}"
tenant_id = "test"
vm_id = "${element(vsphere_virtual_machine.vm.*.id, count.index)}"
}