diff options
Diffstat (limited to 'alma-8-x86_64/http/anaconda-ks.cfg')
-rw-r--r-- | alma-8-x86_64/http/anaconda-ks.cfg | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/alma-8-x86_64/http/anaconda-ks.cfg b/alma-8-x86_64/http/anaconda-ks.cfg new file mode 100644 index 0000000..47ac4cd --- /dev/null +++ b/alma-8-x86_64/http/anaconda-ks.cfg @@ -0,0 +1,56 @@ +clearpart --none --initlabel +bootloader --location=mbr --boot-drive=sda +part biosboot --fstype=biosboot --ondisk=sda --size=1 +part / --fstype=xfs --asprimary --ondisk=sda --grow --label=SLX_SYS +lang en_US.UTF-8 +keyboard --vckeymap=us --xlayouts='us' +timezone Europe/Berlin --isUtc --nontp +text +reboot + +%packages +@core +%end + +%pre --interpreter=/usr/bin/perl +use strict; +use warnings; +use feature 'say'; + +open(my $fp, '<', '/proc/cmdline') or die $!; +chomp(my $line = scalar <$fp>); +close($fp); + +my @tokens = map {/^rootpw=(.*)/ ? $1 : () } + split / /, $line; + +exit if @tokens < 1; + +my $pw = crypt($tokens[0], "\$6\$1U9v8hxj6xmYNJBA\$"); + +open($fp, '>', '/tmp/setup-root-pass') or die $!; +say $fp "rootpw --iscrypted $pw"; +close($fp); +%end + +%include /tmp/setup-root-pass + +%post --erroronfail +set -x +parted -s /dev/sda -- name 2 SLX_SYS +dnf -y install epel-release +dnf -y update +dnf clean all + +# allow root login for ansible +sed -i 's,^[[:blank:]]*#*PermitRootLogin.*,PermitRootLogin yes,g' /etc/ssh/sshd_config + +ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF +DEVICE="eth0" +BOOTPROTO="dhcp" +ONBOOT="yes" +TYPE="Ethernet" +EOF +set +x +%end |