Skip to content

Commit

Permalink
fix(packer): add required_plugins for QEMU
Browse files Browse the repository at this point in the history
Add `required_plugins` and init command for local QEMU plugin

closes #10
Signed-off-by: Shantanoo 'Shan' Desai <shantanoo.desai@gmail.com>
  • Loading branch information
shantanoo-desai committed Jun 11, 2023
1 parent 7565cfd commit b81c52a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,25 @@ FOCAL_VARS_FILE:=./vars/focal.pkrvars.hcl
JAMMY_VARS_FILE:=./vars/jammy.pkrvars.hcl
TEST_TEMPLATE_FILE:=./templates/test.pkr.hcl

test-focal:
init:
packer init ${TEMPLATE_FILE}

test-focal: init
source /etc/os-release; PACKER_LOG=1 packer build -force -var host_distro=$${ID} -var-file=${FOCAL_VARS_FILE} ${TEST_TEMPLATE_FILE}

test-jammy:
test-jammy: init
source /etc/os-release; PACKER_LOG=1 packer build -force -var host_distro=$${ID} -var-file=${JAMMY_VARS_FILE} ${TEST_TEMPLATE_FILE}

build-focal:
build-focal: init
source /etc/os-release; PACKER_LOG=1 packer build -force -var host_distro=$${ID} -var-file=${FOCAL_VARS_FILE} ${TEMPLATE_FILE}

build-jammy:
build-jammy: init
source /etc/os-release; PACKER_LOG=1 packer build -force -var host_distro=$${ID} -var-file=${JAMMY_VARS_FILE} ${TEMPLATE_FILE}

validate-focal:
validate-focal: init
source /etc/os-release; packer validate -var host_distro=$${ID} -var-file=${FOCAL_VARS_FILE} ${TEMPLATE_FILE}

validate-jammy:
validate-jammy: init
source /etc/os-release; packer validate -var host_distro=$${ID} -var-file=${JAMMY_VARS_FILE} ${TEMPLATE_FILE}

validate-packer: validate-focal validate-jammy
Expand Down
8 changes: 8 additions & 0 deletions templates/ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

packer {
required_plugins {
qemu = {
version = ">= 1.0.9"
source = "github.com/hashicorp/qemu"
}
}
}

## Variable will be set via the Command line defined under the `vars` directory
variable "ubuntu_version" {
Expand Down

0 comments on commit b81c52a

Please sign in to comment.