diff --git a/debian12/http/preceed.cfg b/debian12/http/preceed.cfg new file mode 100644 index 0000000..122413e --- /dev/null +++ b/debian12/http/preceed.cfg @@ -0,0 +1,66 @@ +#_preseed_V1 + +# localization +d-i debian-installer/language string en +d-i debian-installer/country string NL +d-i debian-installer/locale string en_US.UTF-8 +d-i keyboard-configuration/xkb-keymap select us + +# mirror +d-i mirror/protocol string http +d-i mirror/country string manual +d-i mirror/http/hostname string ftp.nl.debian.org +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string +d-i mirror/suite string bookworm + +# account +d-i passwd/root-login boolean false +d-i passwd/make-user boolean true +d-i passwd/username string packer +d-i passwd/user-password password packer +d-i passwd/user-password-again password packer + +# timezone +d-i clock-setup/utc boolean true +d-i time/zone string Europe/Amsterdam +d-i clock-setup/ntp boolean true +d-i clock-setup/ntp-server string nl.pool.ntp.org + +# disk partitioning +d-i partman-auto/disk string /dev/vda +d-i partman-auto/method string regular +d-i partman-auto/choose_recipe select atomic +d-i partman-partitioning/confirm_write_new_label boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/mount_style select uuid + +# base system install +d-i base-installer/kernel/image string linux-image-amd64 + +# apt +d-i apt-setup/non-free-firmware boolean true +d-i apt-setup/non-free boolean true +d-i apt-setup/contrib boolean true +d-i apt-setup/disable-cdrom-entries boolean true +d-i apt-setup/services-select multiselect security, updates +d-i apt-setup/security_host string security.debian.org +d-i debian-installer/allow_unauthenticated boolean false + +# package selection +tasksel tasksel/first multiselect standard, ssh-server +d-i pkgsel/upgrade select full-upgrade +popularity-contest popularity-contest/participate boolean false + +# boot loader +d-i grub-installer/only_debian boolean true +d-i grub-installer/bootdev string /dev/vda + +# finalize install +d-i finish-install/reboot_in_progress note +d-i cdrom-detect/eject boolean true + +# remove installation-report +d-i preseed/late_command string in-target apt-get -y purge installation-report diff --git a/debian12/packer.pkr.hcl b/debian12/packer.pkr.hcl new file mode 100644 index 0000000..daefb07 --- /dev/null +++ b/debian12/packer.pkr.hcl @@ -0,0 +1,134 @@ +# packer +packer { + required_plugins { + proxmox = { + version = ">=1.1.8" + source = "github.com/hashicorp/proxmox" + } + } +} + + +# variables +variable "proxmox_iso_pool" { + type = string + default = "" +} + +variable "proxmox_node" { + type = string + default = "" +} + +variable "proxmox_password" { + type = string + default = "" +} + +variable "proxmox_storage_format" { + type = string + default = "raw" +} + +variable "proxmox_storage_pool" { + type = string + default = "" +} + +variable "proxmox_storage_pool_type" { + type = string + default = "rbd" +} + +variable "proxmox_url" { + type = string + default = "" +} + +variable "proxmox_username" { + type = string + default = "" +} + +variable "template_description" { + type = string + default = "Debian 12 Bookworm Template" +} + +variable "template_name" { + type = string + default = "debian.template.siempie.internal" +} + +variable "template_username" { + type = string + default = "" +} + +variable "template_password" { + type = string + default = "" +} + +variable "iso_image" { + type = string + default = "debian-12.5.0-amd64-netinst.iso" +} + +variable "version" { + type = string + default = "" +} + + +# builder +source "proxmox-iso" "template" { + + # boot + boot_command = ["auto url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg"] + boot_wait = "10s" + + # specs + cores = "2" + memory = "4096" + + # storage + disks { + disk_size = "20G" + format = "${var.proxmox_storage_format}" + storage_pool = "${var.proxmox_storage_pool}" + type = "virtio" + } + + # networking + network_adapters { + bridge = "vmbr0" + } + + # misc + http_directory = "debian12/http" + insecure_skip_tls_verify = true + iso_file = "${var.proxmox_iso_pool}/${var.iso_image}" + node = "${var.proxmox_node}" + vm_id = "998" + tags = "mgmt" + os = "l26" + password = "${var.proxmox_password}" + proxmox_url = "${var.proxmox_url}" + scsi_controller = "virtio-scsi-single" + ssh_port = 22 + ssh_timeout = "20m" + ssh_username = "${var.template_username}" + ssh_password = "${var.template_password}" + template_description = "${var.template_description}" + template_name = "${var.template_name}" + unmount_iso = true + username = "${var.proxmox_username}" +} + +build { + sources = ["source.proxmox-iso.template"] + provisioner "shell" { + script = "scripts/debian12.sh" + } +} diff --git a/scripts/debian12.sh b/scripts/debian12.sh new file mode 100644 index 0000000..d90ce2b --- /dev/null +++ b/scripts/debian12.sh @@ -0,0 +1 @@ +echo "> hello ..."