Compare commits
No commits in common. "4b49404a0c4a159f1adba57f346ad8190c6e8fd8" and "dcd80cd7a36d2bf5e0f04a3934b97908b64a43c7" have entirely different histories.
4b49404a0c
...
dcd80cd7a3
@ -4,13 +4,8 @@ HEADLESS ?= true
|
||||
|
||||
default: install
|
||||
|
||||
install: base
|
||||
|
||||
base:
|
||||
PKR_VAR_headless="$(HEADLESS)" packer build x86_64-qemu-base.pkr.hcl
|
||||
|
||||
vagrant:
|
||||
PKR_VAR_headless="$(HEADLESS)" packer build x86_64-qemu-vagrant.pkr.hcl
|
||||
install:
|
||||
packer build -var 'headless=$(HEADLESS)' .
|
||||
|
||||
clean:
|
||||
rm -rf ./builds
|
||||
|
@ -12,8 +12,8 @@ d-i apt-setup/cdrom/set-first boolean false
|
||||
# (Initial) root account setup
|
||||
d-i passwd/make-user boolean false
|
||||
d-i passwd/root-login boolean true
|
||||
# d-i passwd/root-password password debian
|
||||
# d-i passwd/root-password-again password debian
|
||||
d-i passwd/root-password password debian
|
||||
d-i passwd/root-password-again password debian
|
||||
|
||||
# Time
|
||||
d-i clock-setup/utc boolean true
|
||||
|
@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get install -y openssl curl sudo
|
||||
|
||||
useradd -m -p "$(openssl passwd -1 vagrant)" vagrant
|
||||
|
||||
echo "vagrant ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/vagrant
|
||||
chmod 440 /etc/sudoers.d/vagrant
|
||||
|
||||
install -d -m 0700 -o vagrant -g vagrant /home/vagrant/.ssh
|
||||
BASE_GH_URL="https://raw.githubusercontent.com/hashicorp/vagrant/refs/heads"
|
||||
curl -fsSL "${BASE_GH_URL}/main/keys/vagrant.pub" \
|
||||
-o /home/vagrant/.ssh/authorized_keys
|
||||
chmod 600 /home/vagrant/.ssh/authorized_keys
|
||||
|
||||
sed -i 's/PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||
passwd -d root
|
@ -23,10 +23,6 @@ variable "memory" {
|
||||
default = 2048
|
||||
}
|
||||
|
||||
variable "ssh_password" {
|
||||
default = "debian"
|
||||
}
|
||||
|
||||
variable "headless" {
|
||||
default = true
|
||||
}
|
||||
@ -44,7 +40,7 @@ source "qemu" "debian-13-64-base" {
|
||||
accelerator = "kvm"
|
||||
http_directory = "http"
|
||||
ssh_username = "root"
|
||||
ssh_password = var.ssh_password
|
||||
ssh_password = "debian"
|
||||
ssh_timeout = "60m"
|
||||
vm_name = "debian-13-64-base"
|
||||
net_device = "virtio-net"
|
||||
@ -54,8 +50,6 @@ source "qemu" "debian-13-64-base" {
|
||||
"<tab>",
|
||||
" auto=true",
|
||||
" priority=critical",
|
||||
" passwd/root-password=${var.ssh_password}",
|
||||
" passwd/root-password-again=${var.ssh_password}",
|
||||
" hostname=trixie",
|
||||
" domain=",
|
||||
" url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
|
||||
|
@ -1,56 +0,0 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
qemu = {
|
||||
version = ">= 1.1.3"
|
||||
source = "github.com/hashicorp/qemu"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "memory" {
|
||||
default = 2048
|
||||
}
|
||||
|
||||
variable "ssh_password" {
|
||||
default = "debian"
|
||||
}
|
||||
|
||||
variable "headless" {
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "disk_size" {
|
||||
default = 102400
|
||||
}
|
||||
|
||||
source "qemu" "debian-13-64-vagrant" {
|
||||
iso_url = "builds/qemu/debian-13-64-base/debian-13-64-base"
|
||||
disk_image = true
|
||||
iso_checksum = "none"
|
||||
output_directory = "builds/qemu/debian-13-64-vagrant"
|
||||
shutdown_command = "/usr/bin/systemctl poweroff"
|
||||
disk_interface = "virtio"
|
||||
disk_size = var.disk_size
|
||||
memory = var.memory
|
||||
headless = var.headless
|
||||
format = "qcow2"
|
||||
accelerator = "kvm"
|
||||
http_directory = "http"
|
||||
ssh_username = "root"
|
||||
ssh_password = var.ssh_password
|
||||
ssh_timeout = "60m"
|
||||
vm_name = "debian-13-64-base"
|
||||
net_device = "virtio-net"
|
||||
boot_wait = "5s"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "debian-base"
|
||||
sources = ["source.qemu.debian-13-64-vagrant"]
|
||||
|
||||
provisioner "shell" {
|
||||
scripts = [
|
||||
"scripts/vagrant.sh"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user