aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd-image
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-09-23 15:11:58 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-10-11 18:33:35 -0700
commit75892026b595f8c5b6b59cf8cafee8d2a54e10f7 (patch)
treee1735764a333da2dd572b3f20aec55bc27690cb0 /openbsd-image
parentAdd labels to hcloud snapshot (diff)
downloadsite-server-images-75892026b595f8c5b6b59cf8cafee8d2a54e10f7.zip
Fix SSH key and use multiple cpus during the build
The SSH key variable being referenced was incorrect, so we had a syntax error. Furthermore, we need to use multiple CPUs during the image build since if we only use 1 CPU, OpenBSD will use the GENERIC kernel rather than the GENERIC.MP kernel, which means we'll only be able to use 1 CPU.
Diffstat (limited to 'openbsd-image')
-rw-r--r--openbsd-image/openbsd-amd64.pkr.hcl4
-rw-r--r--openbsd-image/openbsd-arm64.pkr.hcl4
-rw-r--r--openbsd-image/variables.pkr.hcl8
3 files changed, 11 insertions, 5 deletions
diff --git a/openbsd-image/openbsd-amd64.pkr.hcl b/openbsd-image/openbsd-amd64.pkr.hcl
index 5d2c9f7..2fef98b 100644
--- a/openbsd-image/openbsd-amd64.pkr.hcl
+++ b/openbsd-image/openbsd-amd64.pkr.hcl
@@ -7,6 +7,7 @@ source "qemu" "openbsd-amd64" {
machine_type = "q35"
cpu_model = "max"
accelerator = "tcg"
+ cpus = var.cpus
memory = var.memory
disk_interface = "virtio"
disk_size = "${var.disk_size}G"
@@ -20,7 +21,7 @@ source "qemu" "openbsd-amd64" {
"/install.conf" = templatefile("${path.root}/templates/install.conf.pkrtpl.hcl", {
hostname = var.hostname
user = var.admin_user
- ssh_key = var.ssh_public_key
+ ssh_key = var.ssh_key
root_password = local.root_password
mirror = var.mirror
version = var.version
@@ -31,7 +32,6 @@ source "qemu" "openbsd-amd64" {
boot_command = [
"<wait>S<enter><wait>",
- "set tty com0<enter><wait>",
"autoinstall<enter><wait>",
"http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.conf<enter>",
]
diff --git a/openbsd-image/openbsd-arm64.pkr.hcl b/openbsd-image/openbsd-arm64.pkr.hcl
index dbe5833..a304426 100644
--- a/openbsd-image/openbsd-arm64.pkr.hcl
+++ b/openbsd-image/openbsd-arm64.pkr.hcl
@@ -7,6 +7,7 @@ source "qemu" "openbsd-arm64" {
machine_type = "virt"
cpu_model = "host"
accelerator = "hvf"
+ cpus = var.cpus
memory = var.memory
disk_interface = "virtio"
disk_size = "${var.disk_size}G"
@@ -20,7 +21,7 @@ source "qemu" "openbsd-arm64" {
"/install.conf" = templatefile("${path.root}/templates/install.conf.pkrtpl.hcl", {
hostname = var.hostname
user = var.admin_user
- ssh_key = var.ssh_public_key
+ ssh_key = var.ssh_key
root_password = local.root_password
mirror = var.mirror
version = var.version
@@ -31,7 +32,6 @@ source "qemu" "openbsd-arm64" {
boot_command = [
"<wait>S<enter><wait>",
- "set tty com0<enter><wait>",
"autoinstall<enter><wait>",
"http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.conf<enter>",
]
diff --git a/openbsd-image/variables.pkr.hcl b/openbsd-image/variables.pkr.hcl
index 4bc0860..e8340a9 100644
--- a/openbsd-image/variables.pkr.hcl
+++ b/openbsd-image/variables.pkr.hcl
@@ -21,7 +21,7 @@ variable "admin_user" {
default = "admin"
}
-variable "ssh_public_key" {
+variable "ssh_key" {
type = string
description = "Public SSH key to associate with the admin user for login"
}
@@ -42,6 +42,12 @@ variable "hostname" {
default = "openbsd-vm"
}
+variable "cpus" {
+ type = number
+ description = "CPUs to allocate to the VM while building the ISO"
+ default = 2
+}
+
variable "memory" {
type = number
description = "Memory to allocate to the VM in MB while building the ISO"