Make root password configurable

This commit is contained in:
Kris Lamoureux 2025-08-17 19:05:57 -04:00
parent dcd80cd7a3
commit 509b6af145
Signed by: kris
GPG Key ID: 105B748C1362EB96
3 changed files with 10 additions and 4 deletions

View File

@ -5,7 +5,7 @@ HEADLESS ?= true
default: install default: install
install: install:
packer build -var 'headless=$(HEADLESS)' . PKR_VAR_headless="$(HEADLESS)" packer build .
clean: clean:
rm -rf ./builds rm -rf ./builds

View File

@ -12,8 +12,8 @@ d-i apt-setup/cdrom/set-first boolean false
# (Initial) root account setup # (Initial) root account setup
d-i passwd/make-user boolean false d-i passwd/make-user boolean false
d-i passwd/root-login boolean true d-i passwd/root-login boolean true
d-i passwd/root-password password debian # d-i passwd/root-password password debian
d-i passwd/root-password-again password debian # d-i passwd/root-password-again password debian
# Time # Time
d-i clock-setup/utc boolean true d-i clock-setup/utc boolean true

View File

@ -23,6 +23,10 @@ variable "memory" {
default = 2048 default = 2048
} }
variable "ssh_password" {
default = "debian"
}
variable "headless" { variable "headless" {
default = true default = true
} }
@ -40,7 +44,7 @@ source "qemu" "debian-13-64-base" {
accelerator = "kvm" accelerator = "kvm"
http_directory = "http" http_directory = "http"
ssh_username = "root" ssh_username = "root"
ssh_password = "debian" ssh_password = var.ssh_password
ssh_timeout = "60m" ssh_timeout = "60m"
vm_name = "debian-13-64-base" vm_name = "debian-13-64-base"
net_device = "virtio-net" net_device = "virtio-net"
@ -50,6 +54,8 @@ source "qemu" "debian-13-64-base" {
"<tab>", "<tab>",
" auto=true", " auto=true",
" priority=critical", " priority=critical",
" passwd/root-password=${var.ssh_password}",
" passwd/root-password-again=${var.ssh_password}",
" hostname=trixie", " hostname=trixie",
" domain=", " domain=",
" url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", " url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",