Files
vms/sources/qemu.pkr.hcl
T

49 lines
1.6 KiB
HCL
Raw Normal View History

2022-06-04 13:23:22 -05:00
variable "qemu_accelerator" {
2023-12-06 08:21:32 -08:00
type = string
default = "kvm"
2022-06-04 13:23:22 -05:00
}
2023-11-27 21:00:35 -06:00
source "qemu" "amd64" {
2024-04-16 23:02:23 -05:00
iso_urls = [ "cache/${basename(var.iso.url)}" ]
2024-04-10 12:56:52 -05:00
iso_target_path = "cache/${basename(var.iso.url)}"
2023-12-06 08:21:32 -08:00
iso_checksum = var.iso.checksum
output_directory = "output/libvirt/${local.name}"
2022-06-04 13:23:22 -05:00
2023-12-06 08:21:32 -08:00
boot_command = var.boot_command
shutdown_command = var.shutdown_command
boot_wait = var.boot_wait
ssh_timeout = local.ssh.timeout
ssh_username = local.ssh.username
ssh_password = local.ssh.password
ssh_handshake_attempts = local.ssh.handshake_attempts
ssh_private_key_file = local.ssh.private_key_file
2022-06-04 13:23:22 -05:00
2023-12-06 08:21:32 -08:00
vm_name = "packer-${local.name}"
disk_size = "${local.disk_size}G"
cpus = local.cpus
memory = local.memory
headless = var.headless
disk_cache = "writeback"
format = "qcow2"
cpu_model = var.cpu_model
2023-12-30 05:37:32 +00:00
efi_boot = true
efi_firmware_code = "${var.efi_dir}OVMF_CODE.fd"
efi_firmware_vars = "${var.efi_dir}OVMF_VARS.fd"
2022-06-04 13:23:22 -05:00
2023-12-06 08:21:32 -08:00
qemuargs = [
#["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"],
2023-12-12 11:57:09 -06:00
["-chardev", "socket,path=${local.name}.qga.sock,server=on,wait=off,id=qga0"],
2023-12-06 08:21:32 -08:00
["-device", "virtio-serial"],
["-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0"],
]
accelerator = var.qemu_accelerator
2023-08-03 14:44:02 -05:00
2023-12-06 08:21:32 -08:00
http_content = var.http_files
http_directory = var.http_directory
2023-12-12 11:57:09 -06:00
http_port_min = var.http_port_min
http_port_max = var.http_port_max
2023-12-06 08:21:32 -08:00
cd_content = var.cd_content
cd_files = var.cd_files
cd_label = var.cd_label
2022-05-02 22:03:37 -05:00
}