-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
112 lines (95 loc) · 1.98 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
variable "vm_name" {
description = "VM name"
type = string
}
variable "vm_description" {
description = "VM decription"
type = string
default = "Managed by Terraform"
}
variable "vm_tags" {
description = "VM tags"
type = list(string)
default = ["terraform"]
}
variable "nodename" {
description = "Proxmox host"
type = string
default = "none"
}
variable "vm_id" {
description = "Proxmox vm id"
type = string
}
variable "cpu" {
description = "CPU configuration"
type = object({
cores = number
type = string
})
default = {
cores = 1
type = "x86-64-v2-AES"
}
}
variable "memory" {
description = "VM memory"
type = number
default = 1024
}
variable "agent" {
description = "QEMU agent"
type = bool
default = true
}
variable "disk" {
description = "VM disk"
type = object({
datastore = string
image = string
interface = string
iothread = bool
discard = string
size = number
format = string
})
validation {
condition = contains(["qcow2", "raw", "vmdk"], var.disk["format"])
error_message = "The disk format is invalid. "
}
# Review this validation rule
validation {
condition = contains(["scsi", "sata", "virtio"], replace(var.disk["interface"], "0", ""))
error_message = "The disk interface is invalid."
}
}
variable "dns" {
description = "VM dns servers"
type = set(string)
}
variable "ipv4" {
description = "VM ipv4 address"
type = map(string)
default = {
address = "dhcp"
gateway = null
}
}
variable "snippet" {
description = "User data - Cloud init"
type = string
default = "none"
}
variable "net_interface" {
description = "VM interface"
type = map(string)
default = {
bridge = "vmbr0"
vlan = "128"
}
}
variable "os_type" {
description = "The Operating System configuration"
type = string
default = "l26"
}