fix boot command and other small improvements

This commit is contained in:
Christian Lempa 2024-09-02 09:36:18 +02:00
parent a9a688ccd6
commit 865ea5db0e

View File

@ -1,6 +1,6 @@
# Ubuntu Server Focal # Ubuntu Server Noble (24.04.x)
# --- # ---
# Packer Template to create an Ubuntu Server (Focal) on Proxmox # Packer Template to create an Ubuntu Server (Noble 24.04.x) on Proxmox
# Variable Definitions # Variable Definitions
variable "proxmox_api_url" { variable "proxmox_api_url" {
@ -75,14 +75,17 @@ source "proxmox-iso" "ubuntu-server-noble" {
# PACKER Boot Commands # PACKER Boot Commands
boot_command = [ boot_command = [
"c<wait>", "<esc><wait>",
"linux /casper/vmlinuz --- autoinstall ds=\"nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/\"", "e<wait>",
"<enter><wait>", "<down><down><down><end>",
"initrd /casper/initrd", "<bs><bs><bs><bs><wait>",
"<enter><wait>", "autoinstall ds=nocloud-net\\;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ---<wait>",
"boot","<enter>"] "<f10><wait>"
]
boot = "c"
boot_wait = "10s" boot_wait = "10s"
communicator = "ssh"
# PACKER Autoinstall Settings # PACKER Autoinstall Settings
http_directory = "http" http_directory = "http"
@ -100,7 +103,8 @@ source "proxmox-iso" "ubuntu-server-noble" {
# ssh_private_key_file = "~/.ssh/id_rsa" # ssh_private_key_file = "~/.ssh/id_rsa"
# Raise the timeout, when installation takes longer # Raise the timeout, when installation takes longer
ssh_timeout = "20m" ssh_timeout = "30m"
ssh_pty = true
} }
# Build Definition to create the VM Template # Build Definition to create the VM Template
@ -115,11 +119,12 @@ build {
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done", "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
"sudo rm /etc/ssh/ssh_host_*", "sudo rm /etc/ssh/ssh_host_*",
"sudo truncate -s 0 /etc/machine-id", "sudo truncate -s 0 /etc/machine-id",
"sudo apt-get -y autoremove --purge", "sudo apt -y autoremove --purge",
"sudo apt-get -y clean", "sudo apt -y clean",
"sudo apt-get -y autoclean", "sudo apt -y autoclean",
"sudo cloud-init clean", "sudo cloud-init clean",
"sudo rm -f /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg", "sudo rm -f /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg",
"sudo rm -f /etc/netplan/00-installer-config.yaml",
"sudo sync" "sudo sync"
] ]
} }