Packer.Images/packer/source.pkr.hcl

62 lines
1.7 KiB
HCL
Raw Permalink Normal View History

source "vsphere-iso" "ubuntu" {
2021-06-07 11:19:00 +00:00
vcenter_server = var.vcenter_server
username = var.vsphere_username
password = var.vsphere_password
insecure_connection = "true"
datacenter = var.vsphere_datacenter
2022-04-25 07:21:05 +00:00
cluster = var.vsphere_cluster
2021-06-07 11:19:00 +00:00
host = var.vsphere_host
folder = var.vsphere_folder
datastore = var.vsphere_datastore
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.vsphere_network
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
export {
images = false
output_directory = "/scratch"
}
2021-06-07 11:19:00 +00:00
}