43 lines
686 B
Plaintext
43 lines
686 B
Plaintext
resource "proxmox_vm_qemu" "vms" {
|
|
for_each = var.vms
|
|
|
|
name = each.key
|
|
target_node = var.target_node
|
|
|
|
clone = each.value.clone != null ? each.value.clone : null
|
|
|
|
cores = each.value.cores
|
|
sockets = 1
|
|
memory = each.value.memory
|
|
|
|
disks {
|
|
ide {
|
|
ide0 {
|
|
disk {
|
|
size = each.value.disk_size
|
|
storage = "local"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
network {
|
|
id = 0
|
|
model = "virtio"
|
|
bridge = var.default_bridge
|
|
tag = each.value.vlan_tag
|
|
}
|
|
|
|
os_type = "cloud-init"
|
|
ipconfig0 = "ip=${each.value.ip_address},gw=${var.default_gateway}"
|
|
|
|
|
|
boot = "order=ide0"
|
|
|
|
tags = "terraform,vm,${each.key}"
|
|
}
|
|
|
|
|
|
|