2023-09-28 16:34:53 +02:00
|
|
|
#Flavour base
|
|
|
|
build {
|
|
|
|
name = "base"
|
|
|
|
description = <<EOF
|
|
|
|
This builder builds a QEMU image from a Debian cloud image.
|
|
|
|
EOF
|
|
|
|
|
|
|
|
source "vmware-iso.debian" {
|
|
|
|
output_directory = "${var.output_dir}/${var.version}/base"
|
2023-10-20 16:19:23 +02:00
|
|
|
vm_name = "${local.output_name}-${var.version}"
|
2023-09-28 16:34:53 +02:00
|
|
|
disk_size = 10240
|
|
|
|
iso_url = "${local.source_iso}"
|
|
|
|
iso_checksum = "${var.iso_cd_checksum}"
|
2023-10-20 16:19:23 +02:00
|
|
|
guest_os_type = "ubuntu-64"
|
2023-09-28 16:34:53 +02:00
|
|
|
http_content = {
|
|
|
|
"/ssh-packer-pub.key" = data.sshkey.install.public_key
|
2023-10-20 16:19:23 +02:00
|
|
|
"/preseed.cfg" = templatefile("${local.locations.provisionning}/${var.name}/http/preseed.cfg.pkrtpl.hcl", { data: data, var: var, local: local })
|
2023-09-28 16:34:53 +02:00
|
|
|
}
|
2023-10-20 16:19:23 +02:00
|
|
|
boot_command = [
|
|
|
|
"<esc><wait>",
|
|
|
|
"auto url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<enter><wait10s>",
|
|
|
|
"<enter>"
|
|
|
|
]
|
2023-09-28 16:34:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
provisioner "shell" {
|
|
|
|
script = "${local.locations.provisionning}/${var.name}/${var.name}-${var.short_version}-install.sh"
|
|
|
|
}
|
|
|
|
|
|
|
|
provisioner "shell" {
|
|
|
|
script = "${local.locations.provisionning}/letsencrypt.sh"
|
|
|
|
}
|
|
|
|
|
|
|
|
post-processor "shell-local" {
|
|
|
|
inline = [
|
|
|
|
"/bin/sh ${path.cwd}/post-processors/sparsify.sh ${var.output_dir}/${var.version}/base ${var.image_version}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
post-processor "manifest" {
|
|
|
|
keep_input_artifact = true
|
|
|
|
}
|
|
|
|
}
|