Files
VMServiceTemplate/terraform/variables.tf

67 lines
1.6 KiB
Terraform
Raw Normal View History

2026-05-20 23:24:33 +01:00
variable "instance_mode" {
2026-05-22 21:59:40 +01:00
type = string
description = "single or multiple"
validation {
condition = contains(["single", "multiple"], var.instance_mode)
error_message = "instance_mode must be either single or multiple."
}
2026-05-20 23:24:33 +01:00
}
variable "instance" {
type = object({
2026-05-22 21:59:40 +01:00
service_name = string
vm_name = string
node_name = string
vm_cpu = optional(number)
vm_ram = optional(number)
vm_size = optional(string)
vm_tags = optional(list(string))
2026-05-20 23:24:33 +01:00
})
default = null
nullable = true
2026-05-22 21:59:40 +01:00
description = "Used only when instance_mode = single."
2026-05-20 23:24:33 +01:00
}
variable "instances" {
type = map(object({
2026-05-22 21:59:40 +01:00
service_name = string
vm_name = string
node_name = string
vm_cpu = optional(number)
vm_ram = optional(number)
vm_size = optional(string)
vm_tags = optional(list(string))
2026-05-20 23:24:33 +01:00
}))
2026-05-22 21:59:40 +01:00
default = {}
nullable = false
description = "Used only when instance_mode = multiple."
2026-05-20 23:24:33 +01:00
}
2026-05-22 21:59:40 +01:00
2026-05-20 23:24:33 +01:00
variable "vm_defaults" {
type = object({
node_datastore = string
vm_bios = string
vm_machine = string
vm_user_sshkey = string
bridge = string
vm_cpu = number
vm_ram = number
2026-05-22 21:59:40 +01:00
vm_size = number
2026-05-20 23:24:33 +01:00
})
default = {
node_datastore = "hlst"
vm_bios = "ovmf"
vm_machine = "q35"
bridge = "vmbr0"
2026-05-22 21:59:40 +01:00
vm_cpu = 2
vm_ram = 4096
vm_size = 20
vm_user_sshkey = ""
2026-05-20 23:24:33 +01:00
}
}
2026-05-22 21:59:40 +01:00
variable "pm_api_url" { default = "https://192.168.10.201:8006/api2/json" }
variable "pm_api_token" { default = "terraform@pve!provider=760580c4-5c1f-462b-986a-dd244c6c95f2" }