summaryrefslogtreecommitdiff
path: root/base-image
diff options
context:
space:
mode:
Diffstat (limited to 'base-image')
-rw-r--r--base-image/Makefile2
-rw-r--r--base-image/base-image.yml1
-rw-r--r--base-image/bookworm-vm.vmdb51
-rwxr-xr-xbase-image/bullseye-vm.sh13
-rw-r--r--base-image/eth0.network5
5 files changed, 58 insertions, 14 deletions
diff --git a/base-image/Makefile b/base-image/Makefile
index 7af2dd1..394a298 100644
--- a/base-image/Makefile
+++ b/base-image/Makefile
@@ -1,4 +1,4 @@
-qcows = bullseye-vm.qcow2
+qcows = bullseye-vm.qcow2 bookworm-vm.qcow2
.SUFFIXES: .vmdb .img .qcow2
diff --git a/base-image/base-image.yml b/base-image/base-image.yml
index 84d938f..d53df26 100644
--- a/base-image/base-image.yml
+++ b/base-image/base-image.yml
@@ -21,6 +21,7 @@
mode: 0600
- shell: |
apt clean
+ sed -i 's/^root:[^:]*:/root::/' /etc/shadow /etc/passwd
vars:
hostname: bullseye
ansible_python_interpreter: /usr/bin/python3
diff --git a/base-image/bookworm-vm.vmdb b/base-image/bookworm-vm.vmdb
new file mode 100644
index 0000000..9d6186c
--- /dev/null
+++ b/base-image/bookworm-vm.vmdb
@@ -0,0 +1,51 @@
+steps:
+ - mkimg: "{{ output }}"
+ size: 4G
+
+ - mklabel: msdos
+ device: "{{ output }}"
+
+ - mkpart: primary
+ device: "{{ output }}"
+ start: 0%
+ end: 50%
+ tag: /
+
+ - kpartx: "{{ output }}"
+
+ - mkfs: ext4
+ partition: /
+
+ - mount: /
+
+ - unpack-rootfs: /
+
+ - debootstrap: bookworm
+ mirror: http://deb.debian.org/debian
+ target: /
+ unless: rootfs_unpacked
+
+ - apt: install
+ packages:
+ - linux-image-amd64
+ recommends: false
+ tag: /
+ unless: rootfs_unpacked
+
+ - cache-rootfs: /
+ unless: rootfs_unpacked
+
+ - chroot: /
+ shell: |
+ apt-get -y install python3 parted acpi
+
+ - fstab: /
+
+ - resize-rootfs: /
+
+ - ansible: /
+ playbook: base-image.yml
+
+ - grub: bios
+ tag: /
+ quiet: false
diff --git a/base-image/bullseye-vm.sh b/base-image/bullseye-vm.sh
deleted file mode 100755
index b40229e..0000000
--- a/base-image/bullseye-vm.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-set -euo pipefail
-
-tarball="$1"
-
-sudo vmdb2 bullseye-vm.vmdb \
- --output bullseye-vm.img \
- --log bullseye-vm.log \
- --rootfs-tarball "$tarball" \
- --verbose
-
-qemu-img convert -f raw -O qcow2 bullseye-vm.img bullseye-vm.qcow2
diff --git a/base-image/eth0.network b/base-image/eth0.network
new file mode 100644
index 0000000..e871c69
--- /dev/null
+++ b/base-image/eth0.network
@@ -0,0 +1,5 @@
+[Match]
+Name=eth0
+
+[Network]
+DHCP=yes