diff --git a/terraform/proxmox/vm/main.tf b/terraform/proxmox/vm/main.tf index d50abdb..4264d1c 100644 --- a/terraform/proxmox/vm/main.tf +++ b/terraform/proxmox/vm/main.tf @@ -64,7 +64,7 @@ resource "proxmox_virtual_environment_vm" "vm" { # VM stays STOPPED after clone. # n8n handles: DHCP reservation → HA affinity rule → VM start # This ensures DHCP is in place before first boot. - started = false + started = var.started # QEMU guest agent is installed in template (via Packer). # Note: Proxmox 9 requires VM.GuestAgent.Audit privilege on the API token. diff --git a/terraform/proxmox/vm/variables.tf b/terraform/proxmox/vm/variables.tf index b19544d..e2d7d86 100644 --- a/terraform/proxmox/vm/variables.tf +++ b/terraform/proxmox/vm/variables.tf @@ -91,3 +91,27 @@ variable "bridge" { description = "Proxmox network bridge for the VM." default = "vmbr0" } + +variable "started" { + type = bool + description = "Whether to start the VM after creation. Pipeline sets false (n8n handles start); manual bootstrap sets true." + default = false +} + +variable "use_dhcp" { + type = bool + description = "Use DHCP (pipeline mode) or static IP (bootstrap mode)." + default = true +} + +variable "subnet_mask" { + type = number + description = "Subnet mask in CIDR notation (e.g., 24). Only used when use_dhcp = false." + default = 24 +} + +variable "gateway" { + type = string + description = "Default gateway. Only used when use_dhcp = false." + default = "10.1.71.1" +} \ No newline at end of file