change test for available_ip by available_ip
This commit is contained in:
parent
af8d274163
commit
10415c275d
8
main.tf
8
main.tf
|
@ -2,14 +2,14 @@ data "netbox_prefix" "network" {
|
||||||
cidr = var.netbox_prefix
|
cidr = var.netbox_prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "netbox_available_ip_address" "test" {
|
resource "netbox_available_ip_address" "available_ip" {
|
||||||
prefix_id = data.netbox_prefix.network.id
|
prefix_id = data.netbox_prefix.network.id
|
||||||
description = var.name
|
description = var.name
|
||||||
dns_name = var.dns_name
|
dns_name = var.dns_name
|
||||||
}
|
}
|
||||||
|
|
||||||
output "ip_addr" {
|
output "ip_addr" {
|
||||||
value = netbox_available_ip_address.test.ip_address
|
value = netbox_available_ip_address.available_ip.ip_address
|
||||||
}
|
}
|
||||||
|
|
||||||
data "xenorchestra_sr" "local_storage" {
|
data "xenorchestra_sr" "local_storage" {
|
||||||
|
@ -39,7 +39,7 @@ resource "xenorchestra_vm" "bar" {
|
||||||
ssh_keys = var.ssh_keys
|
ssh_keys = var.ssh_keys
|
||||||
})
|
})
|
||||||
cloud_network_config = templatefile("cloud_network_config.tftpl", {
|
cloud_network_config = templatefile("cloud_network_config.tftpl", {
|
||||||
ip = "${replace(netbox_available_ip_address.test.ip_address, "var.netmask_netbox", var.netmask)}"
|
ip = "${replace(netbox_available_ip_address.available_ip.ip_address, "var.netmask_netbox", var.netmask)}"
|
||||||
gateway = var.gateway
|
gateway = var.gateway
|
||||||
})
|
})
|
||||||
name_label = var.name
|
name_label = var.name
|
||||||
|
@ -75,7 +75,7 @@ resource "local_file" "inventory" {
|
||||||
filename = "inventory"
|
filename = "inventory"
|
||||||
content = <<EOF
|
content = <<EOF
|
||||||
[all]
|
[all]
|
||||||
${split("/", netbox_available_ip_address.test.ip_address)[0]}
|
${split("/", netbox_available_ip_address.available_ip.ip_address)[0]}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user