-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_kickstart_rhel8.sh
executable file
·74 lines (65 loc) · 2.04 KB
/
generate_kickstart_rhel8.sh
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
#! /bin/bash
source ./scripts/settings_upi.env
echo "Updating ./scripts/rhel-worker.sh to match environment"
sed -i 's|^SCRIPTS_URL=.*|SCRIPTS_URL='"${KS_SCRIPTS_URL}"'|' ./scripts/rhel-worker.sh
echo "Done"
# For customization see the Kickstart reference:
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/performing_an_advanced_rhel_installation/index#kickstart_references
echo "Generating Kickstart file"
cat > rhel8-worker-ks.cfg <<EOT
lang en_US
keyboard us
timezone America/New_York --isUtc
rootpw ${ROOT_PASSWORD} --plaintext
#platform x86, AMD64, or Intel EM64T
reboot
url --url=${RHEL_BASEOS_URL}/
bootloader --location=mbr --boot-drive=${RHEL_INSTALL_DEV} --append="rhgb quiet crashkernel=auto"
ignoredisk --only-use=${RHEL_INSTALL_DEV}
zerombr
clearpart --all --initlabel
# WARNING: cannot have a "swap" partition or Kubelet will fail to start
# Remove "home" partition to avoid wasting disk
autopart --noswap --nohome
auth --passalgo=sha512 --useshadow
selinux --enforcing
firewall --enabled --ssh
skipx
firstboot --disable
user --name=core --groups=wheel --password=${ROOT_PASSWORD} --plaintext
##### START POST-INSTALL ###################################
%post --interpreter=/bin/bash --erroronfail --log=/root/ks-post.log
set -eux
# enable passwordless sudo for wheel
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/wheel
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
# Get OCP Node Customizatons
curl -s ${KS_POST_SCRIPT} | bash /dev/stdin ${KS_POST_SCRIPT_OPTIONS}
%end
###### END POST-INSTALL ###################################
%packages
@standard
-fprintd-pam
-nmap-ncat
-plymouth
-tcpdump
-wget
-cockpit
-dos2unix
-mailcap
-man-pages
-mlocate
-mtr
-nano
-realmd
-usbutils
-words
-insights-client
tree
jq
%end
# Adding ISO content as permanent repos
repo --name=appstream-iso --baseurl=${RHEL_APPSTREAM_URL}/ --install --cost=1
repo --name=rhel8rt-iso --baseurl=${RHEL_RT_URL}/ --install --cost=1
EOT
echo "Done. Kickstart 'rhel8-worker-ks.cfg' generated. Upload to the web server."