Merge branch 'fix_variable_name' into 'main'

Fix variable name

See merge request ataxya/tsunami!1
This commit is contained in:
Ataxya 2022-06-29 21:04:44 +00:00
commit 4f506127f1

12
main.tf
View File

@ -1,15 +1,15 @@
data "netbox_prefix" "test" {
data "netbox_prefix" "network" {
cidr = var.netbox_prefix
}
resource "netbox_available_ip_address" "test" {
prefix_id = data.netbox_prefix.test.id
resource "netbox_available_ip_address" "available_ip" {
prefix_id = data.netbox_prefix.network.id
description = var.name
dns_name = var.dns_name
}
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" {
@ -39,7 +39,7 @@ resource "xenorchestra_vm" "bar" {
ssh_keys = var.ssh_keys
})
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
})
name_label = var.name
@ -75,7 +75,7 @@ resource "local_file" "inventory" {
filename = "inventory"
content = <<EOF
[all]
${split("/", netbox_available_ip_address.test.ip_address)[0]}
${split("/", netbox_available_ip_address.available_ip.ip_address)[0]}
EOF
}