2023-04-16 23:12:52 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
2024-02-07 00:16:21 +01:00
|
|
|
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
|
2023-04-16 23:12:52 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
|
2024-10-06 23:01:39 +02:00
|
|
|
source "qemu" "ubuntu22" {
|
2023-04-16 23:12:52 +02:00
|
|
|
disk_image = true
|
2024-10-06 23:01:39 +02:00
|
|
|
iso_url = "https://cloud-images.ubuntu.com/${var.release.ubuntu22.codename}/current/${var.release.ubuntu22.codename}-server-cloudimg-amd64.img"
|
|
|
|
iso_checksum = "file:https://cloud-images.ubuntu.com/${var.release.ubuntu22.codename}/current/SHA256SUMS"
|
|
|
|
iso_target_path = "${var.iso_dir}/ubuntu22-cloudimg-amd64.img"
|
2024-03-15 15:56:57 +01:00
|
|
|
cpu_model = "host"
|
2023-07-18 23:23:47 +02:00
|
|
|
cpus = 6
|
|
|
|
memory = 4096
|
2024-03-15 15:56:57 +01:00
|
|
|
disk_size = var.disk_size
|
2023-07-18 23:23:47 +02:00
|
|
|
accelerator = "kvm"
|
|
|
|
headless = true
|
2023-09-15 22:56:28 +02:00
|
|
|
ssh_username = var.username
|
|
|
|
ssh_password = var.password
|
2023-07-18 23:23:47 +02:00
|
|
|
ssh_port = 22
|
2024-10-06 23:01:39 +02:00
|
|
|
ssh_wait_timeout = "1000s"
|
2023-07-18 23:23:47 +02:00
|
|
|
disk_compression = true
|
|
|
|
disk_detect_zeroes = "unmap"
|
|
|
|
disk_discard = "unmap"
|
2024-10-06 23:01:39 +02:00
|
|
|
output_directory = var.output
|
|
|
|
vm_name = "${var.prefix}${source.name}-${var.flavor}.qcow2"
|
2023-07-18 23:23:47 +02:00
|
|
|
boot_wait = "10s"
|
2023-09-15 22:56:28 +02:00
|
|
|
firmware = var.firmware
|
2023-07-18 23:23:47 +02:00
|
|
|
shutdown_command = "echo ${var.password} | sudo -S /sbin/shutdown -hP now"
|
|
|
|
cd_label = "cidata"
|
|
|
|
cd_content = {
|
|
|
|
"meta-data" = ""
|
2024-10-06 23:01:39 +02:00
|
|
|
"user-data" = templatefile("${path.cwd}/packer/init/${source.name}-${var.flavor}.user-data.yml",
|
2023-07-18 23:23:47 +02:00
|
|
|
{
|
|
|
|
username = "${var.username}"
|
|
|
|
password = "${var.password}"
|
|
|
|
ssh_key = file("${var.ssh_publickey}")
|
|
|
|
hostname = "${var.prefix}${source.name}"
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2024-01-27 20:34:41 +01:00
|
|
|
|
2024-10-06 23:01:39 +02:00
|
|
|
source "qemu" "ubuntu24" {
|
2024-01-27 20:34:41 +01:00
|
|
|
disk_image = true
|
|
|
|
iso_url = "https://cloud-images.ubuntu.com/${var.release.ubuntu24.codename}/current/${var.release.ubuntu24.codename}-server-cloudimg-amd64.img"
|
|
|
|
iso_checksum = "file:https://cloud-images.ubuntu.com/${var.release.ubuntu24.codename}/current/SHA256SUMS"
|
2024-10-06 23:01:39 +02:00
|
|
|
iso_target_path = "${var.iso_dir}/ubuntu24-cloudimg-amd64.img"
|
2024-03-15 15:56:57 +01:00
|
|
|
cpu_model = "host"
|
2024-01-27 20:34:41 +01:00
|
|
|
cpus = 6
|
|
|
|
memory = 4096
|
2024-03-15 15:56:57 +01:00
|
|
|
disk_size = var.disk_size
|
2024-01-27 20:34:41 +01:00
|
|
|
accelerator = "kvm"
|
2024-10-06 23:01:39 +02:00
|
|
|
headless = true
|
2024-01-27 20:34:41 +01:00
|
|
|
ssh_username = var.username
|
|
|
|
ssh_password = var.password
|
|
|
|
ssh_port = 22
|
2024-10-06 23:01:39 +02:00
|
|
|
ssh_wait_timeout = "1000s"
|
2024-01-27 20:34:41 +01:00
|
|
|
disk_compression = true
|
|
|
|
disk_detect_zeroes = "unmap"
|
|
|
|
disk_discard = "unmap"
|
2024-10-06 23:01:39 +02:00
|
|
|
output_directory = var.output
|
|
|
|
vm_name = "${var.prefix}${source.name}-${var.flavor}.qcow2"
|
2024-01-27 20:34:41 +01:00
|
|
|
boot_wait = "10s"
|
|
|
|
firmware = var.firmware
|
|
|
|
shutdown_command = "echo ${var.password} | sudo -S /sbin/shutdown -hP now"
|
|
|
|
cd_label = "cidata"
|
|
|
|
cd_content = {
|
|
|
|
"meta-data" = ""
|
2024-10-06 23:01:39 +02:00
|
|
|
"user-data" = templatefile("${path.cwd}/packer/init/${source.name}-${var.flavor}.user-data.yml",
|
2024-01-27 20:34:41 +01:00
|
|
|
{
|
|
|
|
username = "${var.username}"
|
|
|
|
password = "${var.password}"
|
|
|
|
ssh_key = file("${var.ssh_publickey}")
|
|
|
|
hostname = "${var.prefix}${source.name}"
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|