Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Martin Thaler
scripts
Commits
80784a76
Commit
80784a76
authored
Sep 09, 2019
by
Alexander Christoph Bihlmaier
💬
Browse files
Foreman partitiontable Kickstart script
parent
91f14099
Changes
1
Hide whitespace changes
Inline
Side-by-side
foreman/partitiontable-autodetect
0 → 100644
View file @
80784a76
<%#
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment