-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnspawn-bookworm.yaml
More file actions
98 lines (81 loc) · 2.47 KB
/
nspawn-bookworm.yaml
File metadata and controls
98 lines (81 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# debos config file supporting Debian bookworm containers for systemd-nspawn.
# By default this machine expects you'll use macvlan networking.
# Variables for arch, hostname, and upstream Debian mirror.
{{- $arch := or .arch "amd64" }}
{{- $hostname := or .hostname "localhost" }}
{{- $mirror := or .mirror "http://deb.debian.org/debian/" }}
architecture: {{ $arch }}
actions:
- action: debootstrap
description: Debootstrap core distro
suite: "bookworm"
variant: "minbase"
components:
- main
mirror: {{ $mirror }}
- action: run
description: Add security apt repo
chroot: true
command: echo deb http://deb.debian.org/debian-security/ bookworm-security main >> /etc/apt/sources.list
- action: run
description: Add updates apt repo
chroot: true
command: echo deb {{ $mirror }} bookworm-updates main >> /etc/apt/sources.list
- action: run
description: Update packages due to security and updates repo adds
chroot: true
command: apt-get update && apt-get -y dist-upgrade
- action: apt
description: Install expected base packages
recommends: false
packages:
- avahi-daemon
- ca-certificates
- dbus
- iproute2
- less
- libnss-mdns
- libnss-systemd
- libpam-systemd
- locales
- lsb-release
- openssh-server
- sudo
- systemd
- systemd-resolved
- vim-tiny
- action: run
description: Delete any generated SSH server keys
chroot: true
command: rm -vf /etc/ssh/ssh_host*key*
- action: overlay
description: Apply system overlay files
source: overlays/nspawn-bookworm
- action: run
description: Enable first-boot.service
chroot: true
command: systemctl enable first-boot.service
- action: run
description: Enable systemd-networkd
chroot: true
command: systemctl enable systemd-networkd.service
- action: run
description: Generate en_US.UTF-8 locale
chroot: true
command: locale-gen
- action: run
description: Set the default hostname
chroot: true
command: echo {{ $hostname }} > /etc/hostname
- action: run
description: Set the default root password
chroot: true
command: echo "root:password" | chpasswd
- action: run
description: Clean up the apt downloaded files
chroot: true
command: apt-get clean
- action: pack
description: Create tarball of filesystem
file: {{ $arch }}-nspawn-bookworm-{{ $hostname }}.tar.gz
compression: gz