Created
June 23, 2014 17:29
-
-
Save jeid64/2f03952152c5d5e4ae83 to your computer and use it in GitHub Desktop.
Packer Kickstart.cfg for KVM and other hypervisors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The pre script outputs configuration variables for the drives into this file, which we then include to be used by the Kickstart | |
/// interpreter to configure the system. Make sure to include this and if you change it to change it in the pre script. | |
%include /tmp/diskinfo | |
/// Relevant Kickstart commands that you want to run, all the matters is that the %pre section is one of the last in the file. | |
/// Taken from http://lists.centos.org/pipermail/centos/2013-March/133083.html | |
%pre | |
#!/bin/bash | |
if [ -b /dev/vda ] ; then | |
echo "bootloader --location=mbr --driveorder=vda --append=" rhgb crashkernel=auto quiet"" > /tmp/diskinfo | |
echo "zerombr" >> /tmp/diskinfo | |
echo "clearpart --all --drives=vda" >> /tmp/diskinfo | |
echo "part pv.008002 --grow --size=1" >> /tmp/diskinfo | |
echo "volgroup VolGroup --pesize=4096 pv.008002" >> /tmp/diskinfo | |
echo "logvol /home --fstype=ext4 --name=lv_home --vgname=VolGroup --grow --size=100" >> /tmp/diskinfo | |
echo "logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1024 --maxsize=51200" >> /tmp/diskinfo | |
echo "logvol swap --name=lv_swap --vgname=VolGroup --grow --size=1024 --maxsize=6016" >> /tmp/diskinfo | |
echo "part /boot --fstype=ext4 --size=500" >> /tmp/diskinfo | |
elif [ -b /dev/sda ] ; then | |
echo "bootloader --location=mbr --driveorder=sda --append=" rhgb crashkernel=auto quiet"" > /tmp/diskinfo | |
echo "zerombr" >> /tmp/diskinfo | |
echo "clearpart --all --drives=sda" >> /tmp/diskinfo | |
echo "part pv.008002 --grow --size=1" >> /tmp/diskinfo | |
echo "volgroup VolGroup --pesize=4096 pv.008002" >> /tmp/diskinfo | |
echo "logvol /home --fstype=ext4 --name=lv_home --vgname=VolGroup --grow --size=100" >> /tmp/diskinfo | |
echo "logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1024 --maxsize=51200" >> /tmp/diskinfo | |
echo "logvol swap --name=lv_swap --vgname=VolGroup --grow --size=1024 --maxsize=6016" >> /tmp/diskinfo | |
echo "part /boot --fstype=ext4 --size=500" >> /tmp/diskinfo | |
fi | |
%end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment