-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.vmx-full.pkr.hcl
37 lines (34 loc) · 1.53 KB
/
build.vmx-full.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
build {
sources = ["source.vmware-vmx.full"]
# Stage 3 - Custom Scripts
# This section is for scripts that are added custom to the packer build not included
# by the template, these can be anything that needs to happen to prepare the system
provisioner "shell" {
execute_command = "echo '${var.password}' | sudo -S -E bash '{{ .Path }}'"
scripts = [
"${path.root}/custom_scripts/cast-install.sh",
"${path.root}/custom_scripts/cast-sift.sh",
"${path.root}/custom_scripts/cast-clean.sh",
]
}
# Stage X - Sysprep Scripts (Part 2)
# Final Scripts, the last scripts that should be run.
provisioner "shell" {
execute_command = "echo '${var.password}' | sudo -S -E bash '{{ .Path }}'"
scripts = [
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-dhcp-client-state.sh",
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-logfiles.sh",
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-machine-id.sh",
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-network.sh",
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-package-manager-cache.sh",
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-ssh-hostkeys.sh",
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-tmp-files.sh",
"${path.root}/builtin_scripts/virt-sysprep/sysprep-op-disk-space.sh",
]
}
post-processors {
post-processor "shell-local" {
inline = ["ovftool ${var.output_directory}/${var.name}/${var.name}.vmx ${var.output_directory}/${var.name}.ova"]
}
}
}