-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefinitions.pkr.hcl
More file actions
304 lines (294 loc) · 9.07 KB
/
Copy pathdefinitions.pkr.hcl
File metadata and controls
304 lines (294 loc) · 9.07 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# ----------------------------------------------------------------------------
# Name: definitions.pkr.hcl
# Description: Variable definitions for vSphere Packer builds
# Author: Michael Poore (@mpoore)
# URL: https://github.com/mpoore/packer
# ----------------------------------------------------------------------------
# -------------------------------------------------------------------------- #
# Variable Definitions #
# -------------------------------------------------------------------------- #
# Sensitive Variables
variable "vcenter_username" {
type = string
description = "Username used by Packer to connect to vCenter"
sensitive = true
}
variable "vcenter_password" {
type = string
description = "Password used by Packer to connect to vCenter"
sensitive = true
}
variable "admin_username" {
type = string
description = "Default administrative username for this OS"
sensitive = true
default = "root"
}
variable "admin_password" {
type = string
description = "Password for the default administrative user"
sensitive = true
}
variable "build_username" {
type = string
description = "Non-administrative username for this OS"
sensitive = true
}
variable "build_password" {
type = string
description = "Password for the non-administrative user"
sensitive = true
}
variable "build_password_encrypted" {
type = string
description = "Encrypted password for the non-administrative user"
sensitive = true
}
variable "build_configmgmt_user" {
type = string
description = "Name of the user to be used by Configuration Management tooling"
sensitive = true
}
variable "build_configmgmt_key" {
type = string
description = "SSH key for the Configuration Management tooling user"
sensitive = true
}
# vCenter Configuration
variable "vcenter_server" {
type = string
description = "FQDN for the vCenter Server Packer will create this build in"
}
variable "vcenter_insecure" {
type = bool
description = "Validate the SSL connection to vCenter"
default = true
}
variable "vcenter_datacenter" {
type = string
description = "Datacenter name in vCenter where the build will be created"
}
variable "vcenter_cluster" {
type = string
description = "Cluster name in vCenter where the build will be created"
}
variable "vcenter_folder" {
type = string
description = "Folder path in vCenter where the build will be created"
}
variable "vcenter_datastore" {
type = string
description = "vSphere datastore where the build will be created"
}
variable "vcenter_network" {
type = string
description = "vSphere network where the build will be created"
}
# vCenter and ISO Configuration
variable "os_iso_datastore" {
type = string
description = "vSphere datastore name where source OS media reside"
}
variable "os_iso_path" {
type = string
description = "Datastore path to the OS media"
}
variable "os_iso_file" {
type = string
description = "OS media file"
}
# OS Meta Data
variable "vm_os_family" {
type = string
description = "The family that the OS belongs to (e.g. 'Windows' or 'Linux')"
}
variable "vm_os_vendor" {
type = string
description = "The vendor or product name for the OS (e.g. 'Photon', 'RHEL', 'CentOS, 'Ubuntu', 'Windows' etc)"
}
variable "vm_os_type" {
type = string
description = "The type of OS (e.g. 'Server' or 'Desktop')"
default = "Server"
}
variable "vm_os_version" {
type = string
description = "The major version of the OS (e.g. '7', '8.5', '2022')"
}
# Virtual Machine OS Settings
variable "vm_guestos_type" {
type = string
description = "The type of guest operating system (or guestid) in vSphere"
}
variable "vm_guestos_language" {
type = string
description = "The language that the guest OS will be configured with"
default = "en-GB"
}
variable "vm_guestos_keyboard" {
type = string
description = "The keyboard type that the guest OS will use"
default = "en-GB"
}
variable "vm_guestos_timezone" {
type = string
description = "The timezone the guest OS will be set to"
default = "GMT Standard Time"
}
variable "vm_guestos_systemlocale" {
type = string
description = "The language that the guest OS will be configured with"
default = "en-US"
}
# Virtual Machine Hardware Settings
variable "vm_firmware" {
type = string
description = "Type of VM firmware to use (one of 'efi', 'efi-secure' or 'bios')"
default = "efi-secure"
}
variable "vm_hardware_version" {
type = number
description = "Version of VM hardware to use (e.g. '18' or '19' etc)"
default = 19
}
variable "vm_boot_order" {
type = string
description = "Set the comma-separated boot order for the VM (e.g. 'disk,cdrom')"
default = "disk,cdrom"
}
variable "vm_boot_wait" {
type = string
description = "Set the delay for the VM to wait after booting before the boot command is sent (e.g. '1h5m2s' or '2s')"
default = "2s"
}
variable "vm_tools_policy" {
type = bool
description = "Upgrade VM tools on reboot?"
default = true
}
variable "vm_cpu_sockets" {
type = number
description = "The number of CPU sockets for the VM"
default = 1
}
variable "vm_cpu_cores" {
type = number
description = "The number of cores per CPU socket for the VM"
default = 1
}
variable "vm_cpu_hotadd" {
type = bool
description = "Enable CPU hot-add"
default = false
}
variable "vm_mem_size" {
type = number
description = "The size of memory in MB for the VM"
default = 2048
}
variable "vm_mem_hotadd" {
type = bool
description = "Enable Memory hot-add"
default = false
}
variable "vm_cdrom_type" {
type = string
description = "Type of CD-ROM drive to add to the VM (e.g. 'sata' or 'ide')"
default = "sata"
}
variable "vm_cdrom_remove" {
type = bool
description = "Remove CD-ROM drives when provisioning is complete?"
default = true
}
variable "vm_nic_type" {
type = string
description = "Type of network card for the VM (e.g. 'e1000e' or 'vmxnet3')"
default = "vmxnet3"
}
variable "vm_disk_controller" {
type = list(string)
description = "An ordered list of disk controller types to be added to the VM (e.g. one of more of 'pvscsi', 'scsi' etc)"
default = ["pvscsi"]
}
variable "vm_disk_size" {
type = number
description = "The size of system disk in MB for the VM"
default = 40960
}
variable "vm_disk_thin" {
type = bool
description = "Thin provision the disk?"
default = true
}
# vSphere Content Library and Template Configuration
variable "vcenter_convert_template" {
type = bool
description = "Convert the VM to a template?"
default = false
}
variable "vcenter_content_library" {
type = string
description = "Name of the vSphere Content Library to export the VM to"
default = null
}
variable "vcenter_content_library_ovf" {
type = bool
description = "Export to Content Library as an OVF file?"
default = true
}
variable "vcenter_content_library_destroy" {
type = bool
description = "Delete the VM after successfully exporting to a Content Library?"
default = true
}
variable "vcenter_content_library_skip" {
type = bool
description = "Skip adding the VM to a Content Library?"
default = false
}
variable "vcenter_snapshot" {
type = bool
description = "Create a snapshot of the VM?"
default = false
}
variable "vcenter_snapshot_name" {
type = string
description = "Name of the snapshot to be created on the VM"
default = "Created by Packer"
}
# Timeout Settings
variable "vm_ip_timeout" {
type = string
description = "Set the timeout for the VM to obtain an IP address (e.g. '1h5m2s' or '2s')"
default = "30m"
}
variable "vm_shutdown_timeout" {
type = string
description = "Set the timeout for the VM to shutdown after the shutdown command is issued (e.g. '1h5m2s' or '2s')"
default = "30m"
}
# Provisioner Settings
variable "script_files" {
type = list(string)
description = "List of OS scripts to execute"
default = []
}
variable "inline_cmds" {
type = list(string)
description = "List of OS commands to execute"
default = []
}
# Build Settings
variable "build_repo" {
type = string
description = "Source control respository this build comes from"
}
variable "build_branch" {
type = string
description = "Branch of the source control respository this build comes from"
}
variable "build_pkiserver" {
type = string
description = "URL for acquiring SSL certificates"
}