Packer.Images/packer/source.pkr.hcl

61 lines
1.6 KiB
HCL
Raw Normal View History

source "vsphere-iso" "ubuntu" {
vcenter_server = var.hv_fqdn
username = var.hv_username
password = var.hv_password
2021-06-07 11:19:00 +00:00
insecure_connection = "true"
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"
2021-06-07 11:19:00 +00:00
boot_order = "disk,cdrom"
boot_command = [
"e<down><down><down><end>",
" autoinstall ds=nocloud;",
"<F10>"
2021-06-07 11:19:00 +00:00
]
boot_wait = "2s"
2021-06-07 11:19:00 +00:00
communicator = "ssh"
ssh_username = "ubuntu"
2021-06-08 07:24:39 +00:00
ssh_password = var.ssh_password
ssh_timeout = "20m"
ssh_handshake_attempts = "100"
ssh_pty = true
CPUs = 4
2022-08-09 13:56:50 +00:00
RAM = 8192
2021-06-07 11:19:00 +00:00
network_adapters {
network = var.hv_network
2021-06-07 11:19:00 +00:00
network_card = "vmxnet3"
}
storage {
2022-08-09 12:56:30 +00:00
disk_size = 76800
2021-06-07 11:19:00 +00:00
disk_thin_provisioned = true
}
disk_controller_type = ["pvscsi"]
usb_controller = ["xhci"]
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"
2021-06-10 09:53:51 +00:00
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"
remove_cdrom = true
2023-04-05 15:30:24 +00:00
2024-06-05 03:09:29 +00:00
export {
output_directory = "/scratch"
}
2021-06-07 11:19:00 +00:00
}