53 lines
1.6 KiB
Django/Jinja
53 lines
1.6 KiB
Django/Jinja
source "qemu" "debian" {
|
|
iso_url = "{{ debian_iso_url }}"
|
|
iso_checksum = "{{ debian_iso_checksum }}"
|
|
|
|
output_directory = "{{ image_output_dir }}/debian-minimal"
|
|
vm_name = "debian-minimal.qcow2"
|
|
shutdown_command = "echo 'packer' | sudo -S shutdown -P now"
|
|
ssh_username = "{{ ssh_username }}"
|
|
ssh_password = "{{ ssh_password }}"
|
|
ssh_timeout = "60m"
|
|
disk_interface = "virtio"
|
|
format = "qcow2"
|
|
accelerator = "kvm"
|
|
|
|
http_directory = "http"
|
|
|
|
headless = true
|
|
|
|
qemuargs = [
|
|
["-m", "2048M"],
|
|
["-smp", "2"],
|
|
["-cpu", "host"],
|
|
["-device", "virtio-rng-pci"]
|
|
]
|
|
|
|
boot_wait = "15s"
|
|
|
|
boot_command = [
|
|
{% raw %}
|
|
"<esc><wait>",
|
|
"<esc><wait>",
|
|
"auto priority=critical interface=auto netcfg/disable_dhcp=false preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg debian-installer=de_DE locale=de_DE.UTF-8 keyboard-configuration/xkb-keymap=de keyboard-configuration/layoutcode=de keyboard-configuration/modelcode=pc105 keyboard-configuration/variant=de console-setup/ask_detect=false netcfg/get_hostname=debian fb=false debconf/frontend=noninteractive initrd=/install.amd/initrd.gz /install.amd/vmlinuz quiet <enter>"
|
|
{% endraw %}
|
|
]
|
|
|
|
}
|
|
|
|
build {
|
|
sources = ["source.qemu.debian"]
|
|
|
|
provisioner "shell" {
|
|
inline = [
|
|
"export DEBIAN_FRONTEND=noninteractive",
|
|
|
|
"sudo apt-get update -y",
|
|
"sudo apt-get install -y sudo curl vim", # 'passwd' ist eh schon da
|
|
|
|
"sudo mkdir -p /root/.ssh",
|
|
"curl -fsSL '{{ ssh_key_url }}' | sudo tee /root/.ssh/authorized_keys",
|
|
"sudo chmod 600 /root/.ssh/authorized_keys"
|
|
]
|
|
}
|
|
}
|