aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd-image/variables.pkr.hcl
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-09-22 17:00:53 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-10-11 18:33:35 -0700
commitc9cfdbf86f2bf620c986abb2f67dcaabf5b01047 (patch)
tree23be01d9eb5cee38e1919e83d633ceff977f8f78 /openbsd-image/variables.pkr.hcl
parentRemove need for explicit memory var override (diff)
downloadsite-server-images-c9cfdbf86f2bf620c986abb2f67dcaabf5b01047.zip
Add support for hcloud openbsd image snapshot
Diffstat (limited to 'openbsd-image/variables.pkr.hcl')
-rw-r--r--openbsd-image/variables.pkr.hcl55
1 files changed, 55 insertions, 0 deletions
diff --git a/openbsd-image/variables.pkr.hcl b/openbsd-image/variables.pkr.hcl
new file mode 100644
index 0000000..4bc0860
--- /dev/null
+++ b/openbsd-image/variables.pkr.hcl
@@ -0,0 +1,55 @@
+variable "version" {
+ type = string
+ description = "Version of OpenBSD to build"
+ validation {
+ condition = can(regex("^\\d\\.\\d$", var.version))
+ error_message = "The version must be a single-digit followed by a period followed by another single digit."
+ }
+}
+
+variable "arch" {
+ type = string
+ validation {
+ condition = contains(["amd64", "arm64"], var.arch)
+ error_message = "The arch must be one of: amd64, arm64."
+ }
+}
+
+variable "admin_user" {
+ type = string
+ description = "Username of the admin user on the VM"
+ default = "admin"
+}
+
+variable "ssh_public_key" {
+ type = string
+ description = "Public SSH key to associate with the admin user for login"
+}
+
+variable "mirror" {
+ type = string
+ description = "URL basename for where to download the OpenBSD ISO."
+ default = "https://cdn.openbsd.org"
+ validation {
+ condition = can(regex("^(https?)://", var.mirror)) && !endswith(var.mirror, "/")
+ error_message = "URL must start with http(s):// and must not have a trailing slash."
+ }
+}
+
+variable "hostname" {
+ type = string
+ description = "Hostname for the VM"
+ default = "openbsd-vm"
+}
+
+variable "memory" {
+ type = number
+ description = "Memory to allocate to the VM in MB while building the ISO"
+ default = 4096
+}
+
+variable "disk_size" {
+ type = number
+ description = "Size of the disk in GB while building the ISO"
+ default = 16
+}