Packer.Images/packer/source.pkr.hcl

64 lines
2.0 KiB
HCL
Raw Normal View History

source "vsphere-iso" "ubuntu" {
vcenter_server = var.hv_fqdn
username = var.hv_username
password = var.hv_password
insecure_connection = "true"
2021-06-07 11:19:00 +00:00
datacenter = var.hv_datacenter
cluster = var.hv_cluster
host = var.hv_host
folder = var.hv_folder
datastore = var.hv_datastore
2021-06-07 11:19:00 +00:00
guest_os_type = "ubuntu64Guest"
boot_order = "disk,cdrom"
boot_command = [
"e<down><down><down><end>",
2024-06-06 06:54:05 +00:00
" autoinstall network-config=disabled ds=nocloud;",
"<F10>"
2021-06-07 11:19:00 +00:00
]
boot_wait = "2s"
communicator = "ssh"
ssh_username = "ubuntu"
ssh_password = var.ssh_password
ssh_timeout = "20m"
ssh_handshake_attempts = "100"
ssh_pty = true
CPUs = 4
RAM = 8192
2021-06-07 11:19:00 +00:00
network_adapters {
network = var.hv_network
network_card = "vmxnet3"
2021-06-07 11:19:00 +00:00
}
storage {
disk_size = 76800
disk_thin_provisioned = true
2021-06-07 11:19:00 +00:00
}
disk_controller_type = ["pvscsi"]
usb_controller = ["xhci"]
2021-06-07 11:19:00 +00:00
set_host_for_datastore_uploads = true
cd_files = [
"packer/preseed/UbuntuServer22.04/user-data",
"packer/preseed/UbuntuServer22.04/meta-data"
2021-06-07 11:19:00 +00:00
]
cd_label = "cidata"
iso_url = local.iso_authenticatedurl
iso_checksum = var.iso_checksum
2021-06-07 11:19:00 +00:00
shutdown_command = "echo '${var.ssh_password}' | sudo -S shutdown -P now"
shutdown_timeout = "5m"
2021-06-07 11:19:00 +00:00
remove_cdrom = true
2023-04-05 15:30:24 +00:00
2024-06-05 03:09:29 +00:00
export {
2024-06-07 02:22:22 +00:00
output_directory = "/data/scratch"
2024-06-05 03:09:29 +00:00
}
destroy = true
2021-06-07 11:19:00 +00:00
}