blob: 26422d3b7e0df6e4c1064fd08a20b13e9ca58685 (
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
|
%pre --interpreter=/bin/bash
set -Eeu -o pipefail
# get the primary interface name
interface=$(ip route list default | cut -d' ' -f5)
# parse DHCP lease info
declare -A dhcp
while IFS= read -r line; do
dhcp["${line%% =*}"]=${line#*= }
done <<< $(nmcli --terse --fields dhcp4 device show "$interface" | cut -d: -f2-)
# configure interface for DHCP
printf 'network --bootproto=dhcp --device=%q --hostname=%q --onboot=yes --noipv6\n' \
"$interface" \
"${dhcp[host_name]:-rocky-kickstart}" \
> /tmp/network.ks
# if ntp-server was specified by DHCP server, use it
if [ -n "${dhcp[ntp_servers]:-}" ]; then
printf 'timezone %q --utc --ntpservers=%q\n' \
{{ pxe_ks_timezone | quote }} \
"${dhcp[ntp_servers]}" \
> /tmp/timezone.ks
else
printf 'timezone %q --utc\n' {{ pxe_ks_timezone | quote }} > /tmp/timezone.ks
fi
%end
# installer configuration
cmdline
eula --agreed
reboot
# system configuration
firstboot --disabled
firewall --disabled
keyboard --vckeymap=us
lang {{ pxe_ks_locale }}
rootpw --iscrypted {{ pxe_ks_password | password_hash("sha512", pxe_ks_password_salt | default("")) }}
selinux --disabled
skipx
{% for pubkey in pxe_ks_authorized_keys %}
sshkey --username=root "{{ pubkey }}"
{% endfor %}
# network
%include /tmp/network.ks
# timezone
%include /tmp/timezone.ks
# storage
autopart --type=lvm --fstype=xfs --nohome
bootloader --boot-drive=vda --location=mbr --timeout=3
clearpart --drives=vda --all --initlabel
zerombr
# packages
%packages
@^minimal-environment
-plymouth
-iwl100-firmware
-iwl1000-firmware
-iwl105-firmware
-iwl135-firmware
-iwl2000-firmware
-iwl2030-firmware
-iwl3160-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6050-firmware
-iwl7260-firmware
%end
# disable kernel crashdumps
%addon com_redhat_kdump --disable
%end
|