aboutsummaryrefslogtreecommitdiff
path: root/packer/ubuntu-24.04-server.json
diff options
context:
space:
mode:
Diffstat (limited to 'packer/ubuntu-24.04-server.json')
-rw-r--r--packer/ubuntu-24.04-server.json87
1 files changed, 87 insertions, 0 deletions
diff --git a/packer/ubuntu-24.04-server.json b/packer/ubuntu-24.04-server.json
new file mode 100644
index 0000000..397bdba
--- /dev/null
+++ b/packer/ubuntu-24.04-server.json
@@ -0,0 +1,87 @@
+{
+ "variables": {
+ "iso_name": "ubuntu-24.04-live-server-amd64.iso",
+ "iso_url": "https://old-releases.ubuntu.com/releases/24.04/ubuntu-24.04-live-server-amd64.iso",
+ "iso_path": "{{pwd}}/iso/{{user `iso_name`}}",
+ "iso_sha256": "sha256:8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3",
+ "timestamp": "{{isotime `2006-01-02`}}",
+ "headless": "false",
+ "boot_wait": "5s",
+
+ "name": "ubuntu-24.04-server_vm-builder",
+ "cpu": "2",
+ "cores": "2",
+ "ram": "2048",
+ "communicator_username": "root",
+ "communicator_password": "root"
+ },
+
+ "builders": [
+ {
+ "type": "qemu",
+ "format": "qcow2",
+ "accelerator": "kvm",
+ "net_device": "virtio-net",
+ "disk_interface": "virtio",
+ "headless": "{{user `headless`}}",
+ "name": "qemu",
+ "vm_name": "qemu-{{user `name`}}_{{user `timestamp`}}",
+ "disk_size": "{{user `disk_size`}}",
+ "disk_cache": "none",
+ "disk_discard": "unmap",
+ "disk_compression": true,
+ "communicator": "ssh",
+ "ssh_username": "{{user `communicator_username`}}",
+ "ssh_password": "{{user `communicator_password`}}",
+ "ssh_pty": true,
+ "ssh_timeout": "60m",
+ "ssh_handshake_attempts": "1337",
+ "shutdown_command": "shutdown -P now",
+ "boot_wait": "{{user `boot_wait`}}",
+ "boot_command": [
+ "c<wait>",
+ "set gfxpayload=keep<enter><wait>",
+ "linux /casper/vmlinuz --- quiet splash autoinstall ds='nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/'<enter><wait>",
+ "initrd /casper/initrd<enter><wait>",
+ "boot<enter><wait>"
+ ],
+ "iso_urls": [
+ "{{user `iso_path`}}",
+ "{{user `iso_url`}}"
+ ],
+ "iso_checksum": "{{user `iso_sha256`}}",
+ "iso_target_path": "{{user `iso_path`}}",
+ "http_directory": "answer_files",
+ "output_directory": "qemu_{{user `name`}}",
+ "qemuargs": [
+ ["-m", "{{user `ram`}}M"],
+ ["-cpu", "host"],
+ ["-smp", "cpus={{user `cpu`}}"]
+ ]
+ }
+ ],
+
+ "provisioners": [
+ {
+ "type": "shell",
+ "script": "scripts/install-prerequisites.sh"
+ },
+ {
+ "type": "shell",
+ "script": "scripts/sysprep.sh"
+ }
+ ],
+
+ "post-processors": [
+ {
+ "type": "shell-local",
+ "only_on": ["linux"],
+ "environment_vars": [
+ "NAME={{user `name`}}",
+ "TIMESTAMP={{user `timestamp`}}",
+ "OUTPUT={{user `output`}}"
+ ],
+ "script": "scripts/create-checksums.sh"
+ }
+ ]
+}