This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
edgedevice.ks.tmpl
59 lines (46 loc) · 1.75 KB
/
edgedevice.ks.tmpl
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
# set locale defaults for the Install
lang en_US.UTF-8
keyboard us
timezone UTC
# initialize any invalid partition tables and destroy all of their contents
zerombr
# erase all disk partitions and create a default label
clearpart --all --initlabel
# automatically create xfs partitions with no LVM and no /home partition
autopart --type=plain --fstype=xfs --nohome
# reboot after installation is successfully completed
reboot
# installation will run in text mode
text
# activate network devices and configure with DHCP
network --bootproto=dhcp
# set up the OSTree-based install
ostreesetup --nogpg --url=${REPO_URL} --osname=${OS_NAME} --remote=${REMOTE_OS_NAME} --ref=${REF}
%post
#################################################
## Additional scripts run on the installed system
#################################################
# workaround for pause container multi-arch support https://bugzilla.redhat.com/show_bug.cgi?id=2011249
cat <<EOF > /etc/containers/containers.conf
[engine]
infra_image = "k8s.gcr.io/pause:3.4.1"
EOF
# configuration for yggdrasil
cat <<EOF > /etc/yggdrasil/config.toml
log-level = "error"
cert-file = "/etc/pki/consumer/cert.pem"
key-file = "/etc/pki/consumer/key.pem"
transport = "http"
client-id-source = "machine-id"
http-server = "${HTTP_API}"
EOF
mkdir -p /etc/pki/consumer
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out /etc/pki/consumer/cert.pem -keyout /etc/pki/consumer/key.pem -subj /CN=flotta-agent
systemctl disable --now firewalld.service
systemctl enable --now nftables.service
systemctl enable --now podman.service
systemctl enable --now podman.socket
systemctl enable --now yggdrasild.service
# FIXME: enable root password for debug purposes, should be removed in production
echo root | passwd --stdin root
%end