tests(packer): update & cleanup tests images.

This commit is contained in:
Alexandre Pujol 2024-10-06 22:01:39 +01:00
parent a5cafe26ea
commit 03b777340d
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
12 changed files with 202 additions and 292 deletions

View file

@ -3,16 +3,13 @@
# SPDX-License-Identifier: GPL-2.0-only
# TODO: Fully automate the creation of the base image
# To save some dev time, 'base_opensuse_kde' is manually created from the opensuse iso with:
# - KDE
# - username/password defined in the variables
# - cloud-init installed and enabled
source "qemu" "opensuse-kde" {
source "qemu" "opensuse" {
disk_image = true
iso_url = "${var.iso_dir}/base_opensuse_kde.qcow2"
iso_checksum = "sha256:62a174725bdf26981d15969e53461b89359f7763450cbfd3e258d4035731279b"
iso_target_path = "${var.iso_dir}/base_opensuse_kde.qcow2"
iso_url = "${var.base_dir}/base-tumbleweed-gnome.qcow2"
iso_checksum = "sha256:223ed62160ef4f1a4f21b69c574f552a07eee6ef66cf66eef2b49c5a7c4864f4"
iso_target_path = "${var.base_dir}/base-tumbleweed-gnome.qcow2"
cpu_model = "host"
cpus = 6
memory = 4096
disk_size = var.disk_size
@ -25,15 +22,15 @@ source "qemu" "opensuse-kde" {
disk_compression = true
disk_detect_zeroes = "unmap"
disk_discard = "unmap"
output_directory = "${var.iso_dir}/packer/"
vm_name = "${var.prefix}${source.name}.qcow2"
output_directory = var.output
vm_name = "${var.prefix}${source.name}-${var.flavor}.qcow2"
boot_wait = "10s"
firmware = var.firmware
shutdown_command = "echo ${var.password} | sudo shutdown -hP now"
cd_label = "cidata"
cd_content = {
"meta-data" = ""
"user-data" = templatefile("${path.cwd}/packer/init/${source.name}.user-data.yml",
"user-data" = templatefile("${path.cwd}/packer/init/${source.name}-${var.flavor}.user-data.yml",
{
username = "${var.username}"
password = "${var.password}"