commit df538458649ec8a5be2ffbb19bd1ac80fb8ce212 Author: Daniel Berteaud Date: Thu Oct 20 14:23:45 2016 +0200 Basic el7 KS diff --git a/el7.ks b/el7.ks new file mode 100644 index 0000000..8670e88 --- /dev/null +++ b/el7.ks @@ -0,0 +1,109 @@ +auth --enableshadow --passalgo=sha512 +url --url="http://mirror.centos.org/centos/7/os/x86_64" +text +skipx +timezone Europe/Paris --isUtc +keyboard --vckeymap=fr-oss --xlayouts='fr (oss)' +lang fr_FR.UTF-8 +services --enabled ntpd +services --disable firewalld +services --disable avahi-daemon +network --bootproto=dhcp --activate --noipv6 +rootpw --iscrypted $6$6OYBD0R8xuGsqAUl$KVHVrjCM6VmLR13TW0exHAl4toKHxQTd9zwbuYzR/t79heCMrAcVmtBmw0wCcNu5zoz1y3LzwdIZjNedRlz7Y/ +zerombr +bootloader --location mbr --append 'ipv6.disable=1' +# Enable fws and epel +repo --name=fws --baseurl=http://repo.firewall-services.com/centos/$releasever +repo --name=epel --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch + +%include /tmp/ks.install +%include /tmp/ks.partitions +reboot + +%packages --nobase --ignoremissing +%include /tmp/ks.packages + +%end + +cat << _EOF >> /tmp/ks.packages +epel-release + +crontabs +dhclient +irqbalance +ntp +openssh-server +passwd +prelink +rootfiles +selinux-policy-targeted +tmpwatch +yum +mailx +net-tools +openssh-clients +rsync +screen +sudo +sysstat +vim +strace +pbzip2 +xz +pxz +iftop +wget +tcpdump +pciutils +nc +lsof + +-iprutil +-kernel-tools +-kexec-tools +-man-db +-microcode_ctl +-parted +-NetworkManager +-NetworkManager-tui +-*-firmware +-b43-openfwwf + +_EOF + +# ensure file exists +touch /tmp/ks.partitions + +# Select first drive +main_drive=$(list-harddrives | awk '$2>=20480 {print $1; nextfile}') +ignore=$(echo $(list-harddrives | awk '$1!="'$main_drive'" {print $1}') | sed -e 's| |,|g') +[ ! -z "$ignore" ] && echo "ignoredisk --drives $ignore" >> /tmp/ks.partitions +cat << _EOF >> /tmp/ks.partitions +clearpart --all --initlabel --drives $main_drive +part /boot --fstype xfs --size 1024 --ondrive $main_drive +part pv.2 --size 17920 --grow --ondrive $main_drive +volgroup main --pesize 4096 pv.2 +logvol / --fstype xfs --name root --vgname main --size 5120 +logvol /var/log --fstype xfs --name log --vgname main --size 5120 +logvol /var --fstype xfs --name log --vgname main --size 5120 +logvol /tmp --fstype xfs --name tmp --vgname main --size 1024 +logvol swap --fstype swap --name swap --vgname main --size 512 +__EOF__ + +################################################ +# Copy logs in the chroot +################################################ +%post --nochroot +cp /tmp/pre.log /mnt/sysimage/root/pre.log +%end + +################################################ +# Post-install processes +################################################ +%post --log /root/post.log + +# Initial SSH keys +cat << __EOF__ >> /root/.ssh/authorized_keys +__EOF__ +chmod 700 /root/.ssh +chown -R root:root /root/.ssh