diff --git a/tests/boxes.yml b/tests/boxes.yml index c1f91d6f..ee7f32ec 100644 --- a/tests/boxes.yml +++ b/tests/boxes.yml @@ -32,6 +32,12 @@ boxes: ram: '6144' cpu: '6' + - name: debian-gnome + box: aa-debian-gnome + uefi: true + ram: '6144' + cpu: '6' + - name: opensuse-kde box: aa-opensuse-kde uefi: true diff --git a/tests/packer/builds.pkr.hcl b/tests/packer/builds.pkr.hcl index a977803e..6334b5fd 100644 --- a/tests/packer/builds.pkr.hcl +++ b/tests/packer/builds.pkr.hcl @@ -7,6 +7,7 @@ build { "source.qemu.archlinux-gnome", "source.qemu.archlinux-kde", "source.qemu.debian-server", + "source.qemu.debian-gnome", "source.qemu.opensuse-kde", "source.qemu.ubuntu-desktop", "source.qemu.ubuntu-server", @@ -31,7 +32,7 @@ build { } provisioner "file" { - only = ["qemu.debian-server", "qemu.ubuntu-server", "qemu.ubuntu-desktop"] + only = ["qemu.debian-server", "qemu.debian-gnome", "qemu.ubuntu-server", "qemu.ubuntu-desktop"] destination = "/tmp/src/" sources = ["${path.cwd}/../apparmor.d_${var.version}-1_amd64.deb"] } diff --git a/tests/packer/debian.pkr.hcl b/tests/packer/debian.pkr.hcl index 9ef66236..11e8c89f 100644 --- a/tests/packer/debian.pkr.hcl +++ b/tests/packer/debian.pkr.hcl @@ -37,3 +37,39 @@ source "qemu" "debian-server" { ) } } + +source "qemu" "debian-gnome" { + disk_image = true + iso_url = "https://cdimage.debian.org/images/cloud/${var.release.debian.codename}/latest/debian-${var.release.debian.version}-genericcloud-amd64.qcow2" + iso_checksum = "file:https://cdimage.debian.org/images/cloud/${var.release.debian.codename}/latest/SHA512SUMS" + iso_target_path = "${var.iso_dir}/debian-cloudimg-amd64.img" + cpus = 4 + memory = 2048 + disk_size = var.disk_size + accelerator = "kvm" + headless = true + ssh_username = var.username + ssh_password = var.password + ssh_port = 22 + ssh_wait_timeout = "1000s" + disk_compression = true + disk_detect_zeroes = "unmap" + disk_discard = "unmap" + output_directory = "${var.output}/" + vm_name = "${var.prefix}${source.name}.qcow2" + boot_wait = "10s" + firmware = var.firmware + shutdown_command = "echo ${var.password} | sudo -S /sbin/shutdown -hP now" + cd_label = "cidata" + cd_content = { + "meta-data" = "" + "user-data" = templatefile("${path.cwd}/packer/init/${source.name}.user-data.yml", + { + username = "${var.username}" + password = "${var.password}" + ssh_key = file("${var.ssh_publickey}") + hostname = "${var.prefix}${source.name}" + } + ) + } +} diff --git a/tests/packer/init/debian-gnome.user-data.yml b/tests/packer/init/debian-gnome.user-data.yml new file mode 100644 index 00000000..15480809 --- /dev/null +++ b/tests/packer/init/debian-gnome.user-data.yml @@ -0,0 +1,56 @@ +#cloud-config + +hostname: ${hostname} +locale: en_IE +keyboard: + layout: ie + +ssh_pwauth: true +users: + - name: ${username} + plain_text_passwd: ${password} + shell: /bin/bash + ssh_authorized_keys: + - ${ssh_key} + lock_passwd: false + sudo: ALL=(ALL) NOPASSWD:ALL + +package_update: true +package_upgrade: true +package_reboot_if_required: false +packages: + - apparmor-profiles + - auditd + - build-essential + - config-package-dev + - debhelper + - devscripts + - htop + - qemu-guest-agent + - rsync + - vim + - task-gnome-desktop + +runcmd: + - apt-get update -y + - apt-get install -y -t bookworm-backports golang-go + +write_files: + + - path: /etc/apt/sources.list + append: true + content: deb http://deb.debian.org/debian bookworm-backports main contrib non-free + + # Network configuration + - path: /etc/systemd/network/20-wired.network + owner: 'root:root' + permissions: '0644' + content: | + [Match] + Name=en* + + [Network] + DHCP=yes + + [DHCPv4] + RouteMetric=10 diff --git a/tests/packer/init/debian-server.user-data.yml b/tests/packer/init/debian-server.user-data.yml index ef6bd719..38e3cad3 100644 --- a/tests/packer/init/debian-server.user-data.yml +++ b/tests/packer/init/debian-server.user-data.yml @@ -20,7 +20,8 @@ package_upgrade: true package_reboot_if_required: false packages: - apparmor-profiles - - build-essential + - auditd + - build-essential - config-package-dev - debhelper - devscripts