Skip to content

Commit 6f76aa9

Browse files
authored
M #-: Resize ubuntu disk only for oneke images (#218)
1 parent d16e96a commit 6f76aa9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packer/ubuntu/ubuntu.pkr.hcl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ build {
1111
}
1212
}
1313

14+
locals {
15+
disk_size = lookup({
16+
"2204oneke" = 3072
17+
"2204oneke.aarch64" = 3072
18+
}, var.version, 0)
19+
}
20+
1421
# Build VM image
1522
source "qemu" "ubuntu" {
1623
cpus = 2
@@ -34,8 +41,8 @@ source "qemu" "ubuntu" {
3441
net_device = "virtio-net"
3542
format = "qcow2"
3643
disk_compression = false
37-
disk_size = 3072
38-
skip_resize_disk = false
44+
skip_resize_disk = local.disk_size == 0 ? true : false
45+
disk_size = local.disk_size == 0 ? null : local.disk_size
3946

4047
output_directory = var.output_dir
4148

0 commit comments

Comments
 (0)