67 lines
2.0 KiB
HCL
67 lines
2.0 KiB
HCL
variable "instance_mode" {
|
|
type = string
|
|
description = "single or multiple"
|
|
|
|
validation {
|
|
condition = contains(["single", "multiple"], var.instance_mode)
|
|
error_message = "instance_mode must be either single or multiple."
|
|
}
|
|
}
|
|
|
|
variable "instance" {
|
|
type = object({
|
|
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))
|
|
})
|
|
default = null
|
|
nullable = true
|
|
description = "Used only when instance_mode = single."
|
|
}
|
|
|
|
variable "instances" {
|
|
type = map(object({
|
|
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))
|
|
}))
|
|
default = {}
|
|
nullable = false
|
|
description = "Used only when instance_mode = multiple."
|
|
}
|
|
|
|
|
|
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
|
|
vm_size = number
|
|
})
|
|
default = {
|
|
node_datastore = "hlst"
|
|
vm_bios = "ovmf"
|
|
vm_machine = "q35"
|
|
vm_user_sshkey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRlWaLBt/qmWY01Cd6jN/YxLnlT+6lg+evEdN/dIajirdTj1rCbAdlG3WYvo+4BpN17HK3/eGQpGUMbgI/8MVd8YPODcD34gaNX0w2v66BwHx+S6BZUpz5T2IoQT0JtSv/TtFICoff5gXdNRpfd4eWsmTioEqLA6oToJLE4dn3jvAzFi9y7fyLqvuoQMmPidYYJjGT30eiULtXNspoEP+GmuWmVEu+znzMWaKDWKdOsii4Cv1aWCRKSDDRzDBrZI2mP+Vm4HDQBdgDYRw4ehumMDtfaSjyJCnrk691bIM+wxzICuIEecg5kq5HcUPvo2mFyWPAEXb5xlXnuopYEBd7 Generated By NeoServer"
|
|
bridge = "vmbr0"
|
|
vm_cpu = 2
|
|
vm_ram = 4096
|
|
vm_size = 20
|
|
}
|
|
}
|
|
|
|
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" }
|