-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvariables.tf
190 lines (156 loc) · 4.68 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# BASE VARIABLES
variable "name" {
description = "The name of the virtual machine used to deploy the vms"
}
variable "datacenter" {
description = "Name of the datacenter you want to deploy the VM to"
}
variable "cluster" {
description = "Name of the cluster you want to deploy the VM to"
}
variable "template" {
description = "Name of the template available in the vSphere"
}
variable "folder" {
description = "Name of the folder where you want available in the vSphere"
type = string
default = null
}
variable "ssh_user" {
description = "Username to connect to ssh"
type = string
}
variable "ssh_password" {
description = "Password to connect to ssh"
type = string
}
variable "annotation" {
description = "A user-provided description of the virtual machine. The default is no annotation."
default = "Managed by Terraform. NEVER EDIT THE VM MANUALY!"
}
variable "instance" {
description = "Number of instance to deploy of same specs"
type = number
default = 1
}
variable "separated" {
description = "Tell if the set of instances needs to be separated accros host"
type = bool
default = false
}
variable "starting_index" {
description = "Starting index for vm name and hostname labelling"
type = number
default = 1
}
variable "after_commands" {
description = "List of commands to run after vm creation"
type = list(string)
default = ["echo 'No additionnals commands passed during provisionning'"]
}
# RESOURCES VARIABLES
variable "datastore" {
description = "Datastore to deploy the VM."
default = null
}
variable "datastore_cluster" {
description = "Datastore to deploy the VM (With DRS only!)."
default = null
}
variable "resource_pool" {
description = "Cluster resource pool that VM will be deployed to. you use following to choose default pool in the cluster (esxi1) or (Cluster)/Resources"
default = null
}
variable "num_cpus" {
description = "number of CPU (core per CPU) for the VM"
type = number
}
variable "num_cores_per_socket" {
description = "The number of cores to distribute among the CPUs in this virtual machine. If specified, the value supplied to num_cpus must be evenly divisible by this value."
type = number
default = 1
}
variable "cpu_hot_add_enabled" {
description = "Allow CPUs to be added to this virtual machine while it is running."
type = bool
default = null
}
variable "cpu_hot_remove_enabled" {
description = "Allow CPUs to be removed to this virtual machine while it is running."
type = bool
default = null
}
variable "memory" {
description = "VM RAM size in megabytes"
type = number
}
variable "memory_hot_add_enabled" {
description = "Allow memory to be added to this virtual machine while it is running."
type = bool
default = true
}
variable "scsi_type" {
description = "Disk adapter for this virtual machine."
type = string
default = null
}
# NETWORKING VARIABLES
variable "hostname" {
description = "default VM hostname for linux guest customization"
type = string
default = null
}
variable "domain" {
description = "default VM domain for linux guest customization"
type = string
default = null
}
variable "nameservers" {
type = list(string)
default = ["1.1.1.1", "1.0.0.1"]
}
variable "networking" {
description = "Networking configuration for the vm."
type = object({
gateway = string
interfaces = list(object({
name = string
portgroup = string
ipv4_address = list(string)
ipv4_netmask = number
}))
})
default = {
interfaces = []
gateway = null
}
}
# STORAGE VARIBLES
variable "boot_disk_size" {
description = "Size of the boot disk (> template) - null for same as template."
type = number
default = null
}
variable "additionnal_storage" {
description = "Storage data disk settings"
type = list(object({
label = string
datastore = string
size = number
thin_provisioned = bool
eagerly_scrub = bool
}))
default = []
}
variable "enable_disk_uuid" {
description = "Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest."
default = null
}
# ****************** WIP ******************
# ****************** WIP ******************
# ****************** WIP ******************
#Linux Customization Variables
variable "hw_clock_utc" {
description = "Tells the operating system that the hardware clock is set to UTC"
default = "true"
}