49 lines
1.6 KiB
HCL
49 lines
1.6 KiB
HCL
source "qemu" "debian" {
|
|
accelerator = "kvm"
|
|
boot_wait = "1s"
|
|
boot_command = [
|
|
"<down><tab>", # non-graphical install
|
|
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
|
|
"language=fr locale=fr_FR.UTF-8 ",
|
|
"country=FR keymap=fr(latin9) ",
|
|
"hostname=packer domain=test ", # Should be overriden after DHCP, if available
|
|
"<enter><wait>",
|
|
]
|
|
cpus = 2
|
|
disk_compression = true
|
|
disk_detect_zeroes = "unmap"
|
|
disk_discard = "unmap"
|
|
skip_compaction = false
|
|
disk_interface = "virtio"
|
|
disk_image = false
|
|
use_backing_file = false
|
|
disk_size = "80G"
|
|
format = "qcow2"
|
|
headless = true
|
|
http_directory = "/packer/httpdir"
|
|
http_port_max = 10082
|
|
http_port_min = 10082
|
|
host_port_min = 2229
|
|
host_port_max = 2229
|
|
vnc_bind_address = "0.0.0.0"
|
|
vnc_port_min = 5900
|
|
vnc_port_max = 5900
|
|
iso_checksum = "${var.iso_checksum}"
|
|
iso_url = "${var.iso_url}"
|
|
memory = 2048
|
|
net_device = "virtio-net"
|
|
output_directory = "output_qcow2"
|
|
// Warning -device order impact network interface naming index ensX
|
|
qemuargs = [
|
|
["-boot", "b"],
|
|
["-device", "virtio-net,netdev=user.0"],
|
|
["-netdev", "user,id=user.0,hostfwd=tcp::{{ .SSHHostPort }}-:22"],
|
|
["-device", "virtio-rng-pci"],
|
|
]
|
|
shutdown_command = "sudo /sbin/shutdown -hP now"
|
|
ssh_password = "${var.ssh_password}"
|
|
ssh_username = "${var.ssh_username}"
|
|
ssh_wait_timeout = "900m"
|
|
vm_name = "debian-${var.image_version}_packer.qcow2"
|
|
}
|