From de40b1e69eaabac3ca01774fa3a4e7abc463ac7c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 3 Oct 2026 08:52:49 -0700 Subject: Customize the disk layout via disklabel templates --- openbsd-image/openbsd-amd64.pkr.hcl | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'openbsd-image/openbsd-amd64.pkr.hcl') diff --git a/openbsd-image/openbsd-amd64.pkr.hcl b/openbsd-image/openbsd-amd64.pkr.hcl index 2fef98b..e19b208 100644 --- a/openbsd-image/openbsd-amd64.pkr.hcl +++ b/openbsd-image/openbsd-amd64.pkr.hcl @@ -17,18 +17,26 @@ source "qemu" "openbsd-amd64" { ssh_password = local.root_password ssh_timeout = "30m" - http_content = { - "/install.conf" = templatefile("${path.root}/templates/install.conf.pkrtpl.hcl", { - hostname = var.hostname - user = var.admin_user - ssh_key = var.ssh_key - root_password = local.root_password - mirror = var.mirror - version = var.version - version_short = local.version_short - arch = var.arch - }) - } + http_port_min = local.http_port + http_port_max = local.http_port + + http_content = merge( + { + "/install.conf" = templatefile("${path.root}/templates/install.conf.pkrtpl.hcl", { + hostname = var.hostname + user = var.admin_user + ssh_key = var.ssh_key + root_password = local.root_password + mirror = var.mirror + version = var.version + version_short = local.version_short + arch = var.arch + disklabel_template = var.disklabel_template + http_port = local.http_port + }) + }, + var.disklabel_template != "" ? { "/disklabel" = var.disklabel_template } : {} + ) boot_command = [ "S", -- cgit v1.2.3