-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsources.pkr.hcl
61 lines (50 loc) · 1.68 KB
/
sources.pkr.hcl
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
source "vsphere-iso" "main" {
vm_name = local.vm_name
notes = "Packer generated VM"
host = var.vsphere_host
insecure_connection = true
username = var.vcenter_username
password = var.vcenter_password
vcenter_server = var.vcenter_server
folder = var.vcenter_folder
create_snapshot = true
snapshot_name = "generalized"
CPUs = var.processor_count
cpu_cores = var.processor_cores
RAM = var.RAM
RAM_reserve_all = true
firmware = "bios"
boot_wait = "5s"
http_content = {
"/ks.cfg" = templatefile(
"${path.root}/http/ks.cfg.pkrtpl.hcl", {
ssh_username = var.ssh_username,
ssh_password = var.ssh_password,
ssh_password_hashed = var.ssh_password_hashed,
packer_username = var.packer_username,
packer_password = var.packer_password,
packer_password_hashed = var.packer_password_hashed,
hostname = var.hostname,
})
}
boot_command = [local.boot_commands]
guest_os_type = "otherGuest64"
iso_paths = [ local.iso_path ]
network_adapters {
network = var.vsphere_network
network_card = "vmxnet3"
}
disk_controller_type = ["pvscsi"]
storage {
disk_size = var.disk_size
disk_thin_provisioned = true
}
shutdown_command = ""
ssh_password = var.ssh_password
ssh_username = var.ssh_username
ssh_handshake_attempts = 10
ssh_timeout = "20m"
remove_cdrom = true
datastore = var.vsphere_datastore
convert_to_template = true
}