diff --git a/images/macos/templates/macOS-12.anka.pkr.hcl b/images/macos/templates/macOS-12.anka.pkr.hcl index 6ff84717..edd828b4 100644 --- a/images/macos/templates/macOS-12.anka.pkr.hcl +++ b/images/macos/templates/macOS-12.anka.pkr.hcl @@ -11,12 +11,27 @@ locals { image_folder = "/Users/${var.vm_username}/image-generation" } +variable "builder_type" { + type = string + default = "veertu-anka-vm-clone" + validation { + condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type) + error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]." + } +} + variable "source_vm_name" { type = string } variable "source_vm_tag" { type = string + default = "" +} + +variable "socks_proxy" { + type = string + default = "" } variable "build_id" { @@ -72,8 +87,15 @@ source "veertu-anka-vm-clone" "template" { stop_vm = "true" } +source "null" "template" { + ssh_host = "${var.source_vm_name}" + ssh_username = "${var.vm_username}" + ssh_password = "${var.vm_password}" + ssh_proxy_host = "${var.socks_proxy}" +} + build { - sources = ["source.veertu-anka-vm-clone.template"] + sources = ["source.${var.builder_type}.template"] provisioner "shell" { inline = ["mkdir ${local.image_folder}"] diff --git a/images/macos/templates/macOS-13.anka.pkr.hcl b/images/macos/templates/macOS-13.anka.pkr.hcl index ee3b447e..9039d4d7 100644 --- a/images/macos/templates/macOS-13.anka.pkr.hcl +++ b/images/macos/templates/macOS-13.anka.pkr.hcl @@ -11,12 +11,27 @@ locals { image_folder = "/Users/${var.vm_username}/image-generation" } +variable "builder_type" { + type = string + default = "veertu-anka-vm-clone" + validation { + condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type) + error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]." + } +} + variable "source_vm_name" { type = string } variable "source_vm_tag" { type = string + default = "" +} + +variable "socks_proxy" { + type = string + default = "" } variable "build_id" { @@ -72,8 +87,15 @@ source "veertu-anka-vm-clone" "template" { stop_vm = "true" } +source "null" "template" { + ssh_host = "${var.source_vm_name}" + ssh_username = "${var.vm_username}" + ssh_password = "${var.vm_password}" + ssh_proxy_host = "${var.socks_proxy}" +} + build { - sources = ["source.veertu-anka-vm-clone.template"] + sources = ["source.${var.builder_type}.template"] provisioner "shell" { inline = ["mkdir ${local.image_folder}"] diff --git a/images/macos/templates/macOS-13.arm64.anka.pkr.hcl b/images/macos/templates/macOS-13.arm64.anka.pkr.hcl index 42e640af..5c12e896 100644 --- a/images/macos/templates/macOS-13.arm64.anka.pkr.hcl +++ b/images/macos/templates/macOS-13.arm64.anka.pkr.hcl @@ -11,12 +11,27 @@ locals { image_folder = "/Users/${var.vm_username}/image-generation" } +variable "builder_type" { + type = string + default = "veertu-anka-vm-clone" + validation { + condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type) + error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]." + } +} + variable "source_vm_name" { type = string } variable "source_vm_tag" { type = string + default = "" +} + +variable "socks_proxy" { + type = string + default = "" } variable "build_id" { @@ -73,8 +88,15 @@ source "veertu-anka-vm-clone" "template" { log_level = "debug" } +source "null" "template" { + ssh_host = "${var.source_vm_name}" + ssh_username = "${var.vm_username}" + ssh_password = "${var.vm_password}" + ssh_proxy_host = "${var.socks_proxy}" +} + build { - sources = ["source.veertu-anka-vm-clone.template"] + sources = ["source.${var.builder_type}.template"] provisioner "shell" { inline = ["mkdir ${local.image_folder}"] diff --git a/images/macos/templates/macOS-14.anka.pkr.hcl b/images/macos/templates/macOS-14.anka.pkr.hcl index 89fccc98..c4b9f456 100644 --- a/images/macos/templates/macOS-14.anka.pkr.hcl +++ b/images/macos/templates/macOS-14.anka.pkr.hcl @@ -11,12 +11,27 @@ locals { image_folder = "/Users/${var.vm_username}/image-generation" } +variable "builder_type" { + type = string + default = "veertu-anka-vm-clone" + validation { + condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type) + error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]." + } +} + variable "source_vm_name" { type = string } variable "source_vm_tag" { type = string + default = "" +} + +variable "socks_proxy" { + type = string + default = "" } variable "build_id" { @@ -72,8 +87,15 @@ source "veertu-anka-vm-clone" "template" { stop_vm = "true" } +source "null" "template" { + ssh_host = "${var.source_vm_name}" + ssh_username = "${var.vm_username}" + ssh_password = "${var.vm_password}" + ssh_proxy_host = "${var.socks_proxy}" +} + build { - sources = ["source.veertu-anka-vm-clone.template"] + sources = ["source.${var.builder_type}.template"] provisioner "shell" { inline = ["mkdir ${local.image_folder}"] diff --git a/images/macos/templates/macOS-14.arm64.anka.pkr.hcl b/images/macos/templates/macOS-14.arm64.anka.pkr.hcl index 360251ef..85ea62da 100644 --- a/images/macos/templates/macOS-14.arm64.anka.pkr.hcl +++ b/images/macos/templates/macOS-14.arm64.anka.pkr.hcl @@ -11,12 +11,27 @@ locals { image_folder = "/Users/${var.vm_username}/image-generation" } +variable "builder_type" { + type = string + default = "veertu-anka-vm-clone" + validation { + condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type) + error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]." + } +} + variable "source_vm_name" { type = string } variable "source_vm_tag" { type = string + default = "" +} + +variable "socks_proxy" { + type = string + default = "" } variable "build_id" { @@ -73,8 +88,15 @@ source "veertu-anka-vm-clone" "template" { log_level = "debug" } +source "null" "template" { + ssh_host = "${var.source_vm_name}" + ssh_username = "${var.vm_username}" + ssh_password = "${var.vm_password}" + ssh_proxy_host = "${var.socks_proxy}" +} + build { - sources = ["source.veertu-anka-vm-clone.template"] + sources = ["source.${var.builder_type}.template"] provisioner "shell" { inline = ["mkdir ${local.image_folder}"]