-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
155 lines (126 loc) · 3.43 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
variable "vsphere_datacenter" {
default = false
type = string
description = "name of datacenter"
}
variable "vsphere_datastore" {
default = false
type = string
description = "name of vsphere datastore"
}
variable "vsphere_resource_pool" {
default = false
type = string
description = "name of resource_pool"
}
variable "annotation" {
default = "====STUTTGART-THINGS/VM===="
type = string
description = "annotation/vm notes in vcenter"
}
variable "vsphere_network" {
default = false
type = string
description = "name of vsphere network"
}
variable "vsphere_vm_template" {
default = false
type = string
description = "name of vsphere vm template"
}
variable "vsphere_vm_name" {
default = "terraform-vm"
type = string
description = "name of vsphere virtual machine"
validation {
condition = can(regex("^[a-zA-Z][a-zA-Z\\-\\0-9]{1,32}$", var.vsphere_vm_name))
error_message = "VM name must start with letter, only contain letters, numbers, dashes, and must be between 1 and 32 characters."
}
}
variable "firmware" {
default = "bios"
type = string
description = "The firmware interface to use on the virtual machine. Can be one of bios or EFI. Default: bios"
}
variable "vsphere_vm_folder_path" {
default = "/"
type = string
description = "target (vm) folder path of vsphere virtual machine"
}
variable "vm_memory" {
default = 4096
type = number
description = "amount of memory of the vm"
}
variable "vm_num_cpus" {
default = 4
type = number
description = "amount of cpus from the vm"
validation {
condition = contains([2, 4, 6, 8, 10, 12, 16], var.vm_num_cpus)
error_message = "Valid values for vm_num_cpus are (2, 4, 6, 8, 10, 12, 16)"
}
}
variable "vm_disk_label" {
default = "disk0"
type = string
description = "label of disk"
}
variable "vm_disk_size" {
default = "32"
type = string
description = "size of disk"
validation {
condition = contains(["20", "32", "64", "96", "128", "196", "256"], var.vm_disk_size)
error_message = "Valid values for vm_disk_size are (20, 32, 64, 96, 128, 196, 256)"
}
}
variable "vm_count" {
default = 1
type = number
description = "amount of vms"
validation {
condition = var.vm_count >= 1 && var.vm_count <= 5 && floor(var.vm_count) == var.vm_count
error_message = "Accepted values: 1-5."
}
}
variable "vm_ssh_user" {
default = false
type = string
description = "username of ssh user for vm"
}
variable "vm_ssh_password" {
default = false
type = string
description = "password of ssh user"
}
variable "bootstrap" {
description = "Bootstrap os"
type = list(string)
default = ["whoami", "hostname"]
}
variable "vsphere_server" {
default = false
type = string
description = "vsphere server"
}
variable "vsphere_user" {
default = false
type = string
description = "password of vsphere user"
}
variable "vsphere_password" {
default = false
type = string
description = "password of vsphere user"
}
variable "unverified_ssl" {
default = true
type = bool
description = "enable unverified_ssl"
}
variable "ssh_agent" {
default = false
type = bool
description = "set to false to disable using ssh-agent to authenticate."
}