-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu-22.04.pkr.hcl
55 lines (51 loc) · 1.51 KB
/
ubuntu-22.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" "ubuntu2204" {
iso_url = "https://releases.ubuntu.com/jammy/ubuntu-22.04.5-live-server-amd64.iso"
iso_checksum = "file:https://releases.ubuntu.com/jammy/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-22.04-autoinstall.yml" = templatefile("${path.root}/ubuntu-22.04-autoinstall.yml", { path = path, hostname = "ubuntu2204" })
}
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-22.04-autoinstall.yml\" --- <enter><wait>",
"initrd /casper/initrd<enter><wait>",
"boot<enter>"
]
qemuargs = [["-serial", "stdio"]]
}
build {
sources = [
"source.qemu.ubuntu2204"
]
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/ubuntu2204"
version = var.version
}
}
}