server_init/packer/http/user-data
Nelis Volschenk 06580f9db6 Add Packer template for building Ubuntu 24.04 server image
Build a QCOW2 image locally with QEMU/KVM + autoinstall, then provision
with the existing Ansible playbook. Allows testing changes locally before
deploying to production. Outputs a ready-to-upload image for hosting providers.

Usage: cp server.pkrvars.hcl.example server.pkrvars.hcl, fill in values,
then run ./build.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 07:28:30 +00:00

32 lines
692 B
Plaintext

#cloud-config
autoinstall:
version: 1
locale: en_US.UTF-8
keyboard:
layout: us
network:
version: 2
ethernets:
id0:
match:
driver: virtio_net
dhcp4: true
storage:
layout:
name: lvm
sizing-policy: all
identity:
hostname: server
username: ubuntu
password: "$6$XjqGOA0giVyHdSZ0$9YqNQlsfuU5xo8uLqpnD49mS3KqyMSp.6imNnIQE18obgTyE0g8LOcL6hvg0sJQXgHv6S7HSIBpKY0.keMXKU."
ssh:
install-server: true
allow-pw: true
packages:
- openssh-server
- curl
- wget
late-commands:
- "echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu"
- "chmod 440 /target/etc/sudoers.d/ubuntu"