I'm new to both Packer and Debian. I'm currently attempting to install Debian using Packer, but I've encountered a challenge: As you can see in the image, the preseed.cfg file isn't being retrieved during the installation process. Is there something I'm overlooking? Below is the Packer code I'm using:
packer {
required_plugins {
vsphere = {
version = "= v1.2.4"
source = "github.com/hashicorp/vsphere"
}
ansible = {
version = "~> 1"
source = "github.com/hashicorp/ansible"
}
inspec = {
version = ">= 0.0.1"
source = "github.com/hashicorp/inspec"
}
}
}
source "vsphere-iso" "srv-lin-debian-base" {
vcenter_server = var.vcenter_server
username = var.vsphere_username
password = var.vsphere_password
insecure_connection = true
vm_name = "${var.vm_name}-debian-base"
cluster = var.vsphere_cluster
resource_pool = var.vsphere_resource_pool
datastore = var.vsphere_datastore
folder = var.vsphere_folder
vm_version = var.vm_hw_version
guest_os_type = "otherGuest"
boot_command = [
"<esc><wait>",
"install <wait>",
"file=/preseed/preseed.cfg <wait>",
"debian-installer=en_US <wait>",
"auto <wait>",
"locale=en_US <wait>",
"kbd-chooser/method=us <wait>",
"fb=false <wait>",
"debconf/frontend=noninteractive <wait>",
"console-setup/ask_detect=false <wait>",
"console-keymaps-at/keymap=us <wait>",
"keyboard-configuration/xkb-keymap=us <wait>",
"<enter><wait>"
]
boot_wait = "15s"
communicator = "ssh"
ssh_username = var.ssh_username
ssh_password = var.ssh_password
ssh_handshake_attempts = "100"
ssh_timeout = "15m"
CPUs = var.vm_numcpu
RAM = var.vm_memory
RAM_reserve_all = true
network_adapters {
network = "DPortGroup-Public"
network_card = "vmxnet3"
}
storage {
disk_controller_index = 0
disk_size = 102400
disk_thin_provisioned = true
}
disk_controller_type = ["pvscsi"]
iso_url = local.iso_authenticatedurl
iso_checksum = var.iso_checksum
export {
force = false
output_directory = "/tmp/vm-export"
}
}
build {
sources = [
"source.vsphere-iso.srv-lin-debian-base"
]
provisioner "shell-local" {
pause_before = "0m30s"
inline = [
"yamllint --version",
"packer --version",
"ansible --version",
"inspec --version",
"ovftool --version"
]
}
provisioner "shell" {
inline = ["echo 'Completed template build'"]
}
}
I didn't find any clear reference in the Packer documentation and going through Debian, they explain the following:
https://www.debian.org/releases/buster/amd64/apbs02.en.html
if you're booting a remastered CD:
preseed/file=/cdrom/preseed.cfg
preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
Note that preseed/url can be shortened to just url, preseed/file to just file, and preseed/file/checksum to just preseed-md5 when they are passed as boot parameters.
Could you please help me with that issue? I really appreciate your time
