From a4db841a7a4327ac8aad943622730223d08231a9 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Wed, 25 Jan 2023 14:40:28 +0100 Subject: [PATCH] Attempt to properly match build w/ source #3 --- packer/build.pkr.hcl | 12 +++++++----- packer/source.pkr.hcl | 4 ---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packer/build.pkr.hcl b/packer/build.pkr.hcl index e97b66c..f754fd3 100644 --- a/packer/build.pkr.hcl +++ b/packer/build.pkr.hcl @@ -6,18 +6,20 @@ packer { build { source "vsphere-iso.ubuntu" { name = "bootstrap" - vm_name = "${var.vm_name}-bootstrap" + vm_name = "ova.bootstrap-${var.vm_name}" export { + images = false output_directory = "/scratch/airgapped-k8s/bootstrap" } } source "vsphere-iso.ubuntu" { name = "upgrade" - vm_name = "${var.vm_name}-upgrade" + vm_name = "ova.upgrade-${var.vm_name}" export { + images = false output_directory = "/scratch/airgapped-k8s/upgrade" } } @@ -44,11 +46,11 @@ build { inline = [ "pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\", " -ApplianceType '${source.name}' \\", - " -OVFFile '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.ovf' \"", + " -OVFFile '/scratch/airgapped-k8s/${source.name}/ova.${source.name}-${var.vm_name}.ovf' \"", "pwsh -file scripts/Update-Manifest.ps1 \\", - " -ManifestFileName '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.mf'", + " -ManifestFileName '/scratch/airgapped-k8s/${source.name}/ova.${source.name}-${var.vm_name}.mf'", "ovftool --acceptAllEulas --allowExtraConfig --overwrite \\", - " '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.ovf' \\", + " '/scratch/airgapped-k8s/${source.name}/ova.${source.name}-${var.vm_name}.ovf' \\", " /output/airgapped-k8s.${source.name}.ova" ] } diff --git a/packer/source.pkr.hcl b/packer/source.pkr.hcl index 174b636..3774c76 100644 --- a/packer/source.pkr.hcl +++ b/packer/source.pkr.hcl @@ -53,8 +53,4 @@ source "vsphere-iso" "ubuntu" { shutdown_timeout = "5m" remove_cdrom = true - - export { - images = false - } }