Files
deploy-sandbox-vms/main.tf
2026-05-12 23:31:19 +02:00

51 lines
831 B
HCL

resource "proxmox_virtual_environment_vm" "lab" {
for_each = local.vms
name = each.key
node_name = var.node_name
vm_id = each.value.vmid
clone {
vm_id = var.template_id
full = true
}
agent {
enabled = true
}
cpu {
sockets = var.vm_cpu_sockets
cores = var.vm_cpu_cores
hotplugged = var.vm_cpu_hotplugged
}
memory {
dedicated = var.vm_memory
}
disk {
interface = "scsi0"
size = var.vm_disk_size
datastore_id = "local-lvm"
}
network_device {
bridge = var.bridge
vlan_id = var.vlan_id
}
initialization {
user_account {
username = var.ci_user
keys = [var.ssh_public_key]
}
ip_config {
ipv4 {
address = "${each.value.ip}/24"
gateway = var.gateway
}
}
}
}