update vm initialization

This commit is contained in:
2026-03-07 21:56:49 -06:00
parent db67f71a3c
commit 40dda3241f

View File

@@ -43,7 +43,8 @@ resource "proxmox_virtual_environment_vm" "vm" {
initialization { initialization {
ip_config { ip_config {
ipv4 { ipv4 {
address = "dhcp" address = var.use_dhcp ? "dhcp" : "${var.ip_address}/${var.subnet_mask}"
gateway = var.use_dhcp ? null : var.gateway
} }
} }
@@ -53,7 +54,7 @@ resource "proxmox_virtual_environment_vm" "vm" {
} }
datastore_id = var.datastore datastore_id = var.datastore
} }
# Network interface # Network interface
network_device { network_device {