diff --git a/Ubuntu-22/ubuntu-22.pkr.hcl b/Ubuntu/ubuntu-22.pkr.hcl similarity index 99% rename from Ubuntu-22/ubuntu-22.pkr.hcl rename to Ubuntu/ubuntu-22.pkr.hcl index 4d5a0b7..78baef0 100644 --- a/Ubuntu-22/ubuntu-22.pkr.hcl +++ b/Ubuntu/ubuntu-22.pkr.hcl @@ -23,7 +23,7 @@ source "proxmox-iso" "ubuntu-22" { # Add kernel command-line to start autoinstall "autoinstall ", - "ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-22/\"", + "ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/\"", "x" ] diff --git a/Ubuntu/ubuntu-24.pkr.hcl b/Ubuntu/ubuntu-24.pkr.hcl new file mode 100644 index 0000000..b829fc6 --- /dev/null +++ b/Ubuntu/ubuntu-24.pkr.hcl @@ -0,0 +1,82 @@ +variable "proxmox_apiuser" { + type = string + default = "packer" +} + +variable "proxmox_apitoken" { + type = string + default = "changeme" +} + +source "proxmox-iso" "ubuntu-24" { + template_name = "ubuntu-24" + template_description = "Ubuntu 24.04, generated on ${timestamp()}" + vm_id = "205" + boot_wait = "10s" + boot_key_interval = "200ms" + boot_command = [ + # Edit boot options + "e", + + # Go to the end of the boot command + " ", + + # Add kernel command-line to start autoinstall + "autoinstall ", + "ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/\"", + "x" + ] + + http_directory = "http" + http_port_max = "8089" + http_port_min = "8080" + + os = "l26" + cores = "2" + sockets = "1" + cpu_type = "host" + memory = "2048" + scsi_controller = "virtio-scsi-single" + disks { + disk_size = "30G" + storage_pool = "templates" + type = "scsi" + } + network_adapters { + bridge = "vmbr0" + model = "virtio" + } + + proxmox_url = "https://kamino.int.metaunix.net:8006/api2/json/" + insecure_skip_tls_verify = true + username = "${var.proxmox_apiuser}" + password = "${var.proxmox_apitoken}" + node = "kamino" + pool = "Templates" + + iso_url = "https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso" + iso_checksum = "sha256:8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3" + iso_storage_pool = "iso" + unmount_iso = true + iso_download_pve = true + + ssh_username = "xadmin" + ssh_password = "packer" + ssh_timeout = "20m" +} + +build { + sources = ["source.proxmox-iso.ubuntu-24"] + + provisioner "shell" { + scripts = [ + "scripts/debian-install.sh", + "scripts/remove-snap.sh" + ] + } + + provisioner "file" { + source = "scripts/initial-setup.sh" + destination = "/home/xadmin/initial-setup.sh" + } +} diff --git a/http/ubuntu-22/meta-data b/http/ubuntu/meta-data similarity index 100% rename from http/ubuntu-22/meta-data rename to http/ubuntu/meta-data diff --git a/http/ubuntu-22/user-data b/http/ubuntu/user-data similarity index 100% rename from http/ubuntu-22/user-data rename to http/ubuntu/user-data