blob: f5df92fbf7cf38d8df995ea87e7d3b8417a3583c (
plain)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
# This is a vmdb2 input file that installs Debian onto my Thinkpad
# X220. It has an SSD as sdb.
steps:
- mklabel: gpt
device: "{{ image }}"
# EFI partition. This MUST be vfat and cleartext so that UEFI BIOS
# can handle it.
- mkpart: primary
device: "{{ image }}"
start: 0%
end: 500M
tag: efi
- mkfs: vfat
partition: efi
# /boot partition. This will be cleartext, because GRUB doesn't seem
# to support LUKS2 yet.
- mkpart: primary
device: "{{ image }}"
start: 500M
end: 1G
tag: boot
- mkfs: ext2
partition: boot
# The physical volume for LVM. This will be encrypted and the
# unlocked, opened variant will be used as the physical volume for
# LVM2.
- mkpart: primary
device: "{{ image }}"
start: 1G
end: 100%
tag: cleartext_pv0
- cryptsetup: cleartext_pv0
password: asdf
name: pv0
- vgcreate: vg0
physical:
- pv0
- lvcreate: vg0
name: root
size: 10G
- mkfs: ext4
partition: root
# Mount the file systems on top of each other.
- mount: root
- mount: boot
dirname: /boot
mount-on: root
- mount: efi
dirname: /boot/efi
mount-on: boot
- virtual-filesystems: root
# Install Debian.
- unpack-rootfs: root
- debootstrap: bullseye
mirror: http://deb.debian.org/debian
target: root
unless: rootfs_unpacked
- apt: install
packages:
- linux-image-amd64
tag: root
unless: rootfs_unpacked
- cache-rootfs: root
unless: rootfs_unpacked
# Create fstab and crypttab
- fstab: root
# Install additional packages. These are not in the rootfs tarball,
# while I keep changing this list: it's easier and faster to iterate
# if the rootfs tarball doesn't need to be re-generated from
# scratch.
- apt: install
packages:
- console-setup
- cryptsetup
- cryptsetup-initramfs
- dosfstools
- ifupdown
- locales-all
- lvm2
- python3
- ssh
tag: root
# Configure the system with Ansible.
- ansible: root
playbook: x220.yml
# Install GRUB as the bootloader.
- grub: uefi
tag: root
efi: efi
quiet: true
image-dev: "{{ image }}"
|