Commit 80784a76 authored by Alexander Christoph Bihlmaier's avatar Alexander Christoph Bihlmaier 💬
Browse files

Foreman partitiontable Kickstart script

parent 91f14099
<%#
kind: ptable
name: Kickstart partitiontable autodetect
oses:
- CentOS
- Fedora
- RedHat
%>
#Dynamic
#!/bin/bash
function installdisk() {
# Host-Variable "installdisk" kann genutzt werden, um eine Installation auf
# einem spezifischem Speicher zu ermöglichen
# 20190813, ACB
if [ "<%= @host.params['installdisk'] %>" ]; then
echo "<%= @host.params['installdisk'] %>"
exit 0
fi
# Generische Erkennung der installdisk - 20190907, ACB
if [ -b /dev/sda ]; then echo "sda"; exit 0
elif [ -b /dev/vda ]; then echo "vda"; exit 0
elif [ -b /dev/nvme0n1 ]; then echo "nvme0n1"; exit 0
fi
}
installdisk=`installdisk`
cat >> /tmp/diskpart.cfg << EOF
zerombr
clearpart --all --initlabel --drives=$installdisk
part /boot --size=1024 --ondrive=$installdisk
part pv.01 --grow --ondrive=$installdisk
volgroup <%= @host.shortname %> pv.01
logvol / --fstype=xfs --name=root --vgname=<%= @host.shortname %> --size 5000
logvol /var --fstype=xfs --name=var --vgname=<%= @host.shortname %> --size 5000
logvol swap --fstype=swap --name=swap --vgname=<%= @host.shortname %> --size 2048
EOF
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment