forked from bn222/cluster-deployment-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kickstart.ks.j2
34 lines (29 loc) · 1.25 KB
/
kickstart.ks.j2
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
ostreesetup --osname=rhel --url=file:///run/install/repo/ostree/repo --ref=rhel/{{ rhel_number }}/{{ uname_m }}/edge --nogpg --remote=edge
reboot
zerombr
clearpart --all --initlabel
part /boot/efi --fstype=efi --size=200
part /boot --fstype=xfs --asprimary --size=800
part swap --fstype=swap --recommended
part pv.01 --grow
volgroup rhel pv.01
network --bootproto=dhcp
logvol / --vgname=rhel --fstype=xfs --size=10000 --name=root
%post --log=/var/log/anaconda/post-install.log --erroronfail
useradd -m -d /home/redhat -p '$6$DYgjv/BVpdq/0EVt$2fd9RPHleTgsFWzTLL/I.znl9vbKgt00eXQ0LNbkc7wBF67fSYBsZd6LutDZHI0YZNg3SKB04SdpLOkuWRzni.' -G wheel redhat
echo -e 'redhat\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
# Make sure redhat user directory contents ownership is correct
chown -R redhat:redhat /home/redhat/
# Add the pull secret to CRI-O and set root user-only read/write permissions
cat << EOF > /etc/crio/openshift-pull-secret
{{ pull_secret }}
EOF
mkdir -p /home/redhat/.ssh
cat << EOF > /home/redhat/.ssh/authorized_keys
{{ ssh_key }}
EOF
chmod 600 /etc/crio/openshift-pull-secret
# Configure the firewall with the mandatory rules for MicroShift
firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16
firewall-offline-cmd --zone=trusted --add-source=169.254.169.1
%end