-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu-24.04.pkr.hcl
55 lines (51 loc) · 1.49 KB
/
ubuntu-24.04.pkr.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
source "qemu" "ubuntu2404" {
iso_url = "https://releases.ubuntu.com/noble/ubuntu-24.04.1-desktop-amd64.iso"
iso_checksum = "file:https://releases.ubuntu.com/noble/SHA256SUMS"
vga = "virtio"
cpus = 2
memory = 4096
headless = var.headless
shutdown_command = "sudo shutdown -P now"
qmp_enable = true
disk_discard = "unmap"
http_content = {
"/ubuntu-autoinstall.yml" = templatefile("${path.root}/ubuntu-autoinstall.yml", { path = path, hostname = "ubuntu2404" })
}
ssh_handshake_attempts = 1000
ssh_timeout = "2h"
ssh_username = "vagrant"
ssh_password = "vagrant"
boot_wait = "10s"
boot_keygroup_interval = "1s"
boot_command = [
"<tab><wait><tab><wait><tab><wait><tab><wait><tab><wait><tab><wait>",
"<tab><wait><tab><wait><tab><wait><tab><wait><tab><wait><tab><wait>",
"c<wait10>",
"set gfxpayload=keep<enter><wait>",
"linux /casper/vmlinuz autoinstall console=ttyS0 ",
"cloud-config-url=\"http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu-autoinstall.yml\" --- <enter><wait>",
"initrd /casper/initrd<enter><wait>",
"boot<enter>"
]
qemuargs = [["-serial", "stdio"]]
}
build {
sources = [
"source.qemu.ubuntu2404"
]
provisioner "shell" {
inline = [
"sudo apt-get clean -y",
]
}
post-processors {
post-processor "vagrant" {
keep_input_artifact = true
vagrantfile_template = "Vagrantfile"
}
post-processor "vagrant-registry" {
box_tag = "gnome-shell-box/ubuntu2404"
version = var.version
}
}
}