shantanoo-desai / packer-ubuntu-server-uefi

Packer Templates for creating Ubuntu Live Server Images with Packer + QEMU + Autoinstall (cloud-init)
Apache License 2.0
38 stars 16 forks source link

Packer version? #10

Closed biocyberman closed 1 year ago

biocyberman commented 1 year ago

I got the following errors when validating. Are they true errors or wrong packer version?

$ packer -v
1.8.7

$ make validate
cloud-init schema -c http/user-data
Valid cloud-config: http/user-data
source /etc/os-release; packer validate -var host_distro=${ID} -var-file=./vars/focal.pkrvars.hcl ./templates/ubuntu.pkr.hcl
/bin/sh: 1: source: not found
Error: Unsupported argument

  on ./templates/ubuntu.pkr.hcl line 71:
  (source code not available)

An argument named "efi_firmware_code" is not expected here.

Error: Unsupported argument

  on ./templates/ubuntu.pkr.hcl line 72:
  (source code not available)

An argument named "efi_firmware_vars" is not expected here.

Error: Unsupported argument

  on ./templates/ubuntu.pkr.hcl line 73:
  (source code not available)

An argument named "efi_boot" is not expected here.

make: *** [Makefile:35: validate-focal] Error 1
biocyberman commented 1 year ago

I figured it out. I added this section at the top of the template files and run packer init again. I don't know what's the minimum version of qemu plugin, but 1.0.9 works.

packer {
  required_plugins {
    qemu = {
      version = ">= 1.0.9"
      source  = "github.com/hashicorp/qemu"
    }
  }
}
shantanoo-desai commented 1 year ago

@biocyberman Thanks for reporting this. I indeed forgot to mention the qemu plugin in the template. I will patch the template with the most updated version that is 1.0.9