# Kickstart file anne.possoz@epfl.ch # Test d'installation machine virtuelle # install url --url http://elle.epfl.ch/centos-5/os/i386 lang en_US.UTF-8 # Deprecated:langsupport --default en_US.UTF-8 fr_CH.UTF-8 fr_FR.UTF-8 keyboard fr_CH # Deprecated:mouse timezone --utc Europe/Zurich selinux --disabled skipx network --device eth0 --bootproto static --ip 128.178.131.5 --netmask 255.255.255.0 --gateway 128.178.131.1 --nameserver 128.178.15.8,128.178.15.7 --hostname ditgepcks rootpw --iscrypted $1$zEeV8QCa$RnfC0Gsxe8QNlqGQgaCB9. firewall --enabled --port=22:tcp authconfig --enableshadow --enablemd5 # # Deprecated avec parametre:zerombr yes zerombr bootloader --location=mbr --driveorder=sda part / --fstype ext3 --size=9216 --asprimary part swap --size=1024 --asprimary # Reboot après installation reboot # #--------------------------------------------------------------------- # # 1) La pre-installation # ---------------------- %pre # # 2) Les packages # --------------- # On inclut le minimum que l'on veut installer #--%ksappend http://128.178.131.4/KS/ks_packages_minimal.part %packages @base @core ntp # gcc et kernel-devel insdispensable pour les vmware tools gcc kernel-devel # Pour support en outre francophone @french-support # On inclut d'autres packages par exemple pour du LAMP # # --------------------------------------------------------- # # 3) POST-INSTALLATION # (Apparemment il est possible d'executer plusieurs %post) # # 3.a) Dans l'environnement de l'installation # ----------------------------------------- %post --nochroot # # Garder les traces de l'installation, en particulier les fichiers: # - tmp/anaconda.log # - INSTALL/tmp/ks.cfg (le fichier kickstart réellement utilisé # /usr/bin/mkdir /mnt/sysimage/root/INSTALL /mnt/sysimage/usr/bin/rsync -a /tmp /mnt/sysimage/root/INSTALL/ # ##--NE MARCHE PAS: Rendre les fichiers kickstart include accessibles dans l'env. installation ##--NE MARCHE PAS: ##--NE MARCHE PAS:/mnt/sysimage/usr/bin/mkdir /tmp/ks ##--NE MARCHE PAS:/mnt/sysimage/usr/bin/cd /tmp/ks ##--NE MARCHE PAS:/mnt/sysimage/usr/bin/wget http://128.178.131.4/KS/include/ks-ntp.cfg # # 3.b) Dans l'environnement de l'OS installé # ---------------------------------------- %post # # Mises à jour et autres réglages # # # Rendre les fichiers kickstart include accessibles dans l'env. installé # Le %include n'est pas confortable donc on le laisse tomber # Grub /bin/cp /boot/grub/grub.conf /boot/grub/grub.conf.DIST # Quelques utilitaires /bin/mkdir /root/bin cd /root/bin /usr/bin/wget http://slpc7.epfl.ch/KS/utils-bin/rpm-q.dates /usr/bin/wget http://slpc7.epfl.ch/KS/utils-bin/heure /bin/chmod +x * cd # Garder des traces de ce qui est install /bin/mkdir /root/ADM /root/bin/rpm-q.dates > /root/ADM/rpm-q.dates.DIST.`/root/bin/heure` /sbin/lspci -v > /root/ADM/lspci-v /sbin/fdisk -l > /root/ADM/fdisk-l # Mise a jour post-installation rpm --import http://ftp.halifax.rwth-aachen.de/centos/RPM-GPG-KEY-CentOS-5 /usr/bin/yum -y update /root/bin/rpm-q.dates > /root/ADM/rpm-q.dates.UPDATE.`/root/bin/heure` # ntp pour le subnet 128.178.131 /bin/cp -p /etc/ntp/step-tickers /etc/ntp/step-tickers.DIST /bin/cp -p /etc/ntp.conf /etc/ntp.conf.DIST echo "128.178.131.1" > /etc/ntp/step-tickers /usr/bin/perl -i.DIST -e 'while(<>){s/server 0.rhel.pool.ntp.org/server 128.178.131.1/g; print;}' /etc/ntp.conf /usr/bin/perl -i.trash -e 'while(<>){s/^\#broadcastclient/broadcastclient/g ; print ;}' /etc/ntp.conf /bin/rm /etc/ntp.conf.trash # Users /usr/sbin/groupadd -g 600 apachers /usr/sbin/useradd -G apachers anne # Securite /bin/cp /etc/hosts.allow /etc/hosts.allow.DIST /bin/cat << EOF >> /etc/hosts.allow ALL: 127.0.0.1 128.178.131.0/255.255.255.0 sshd: 128.178.0.0/255.255.0.0 : allow EOF /bin/cp /etc/hosts.deny /etc/hosts.deny.DIST /bin/cat << EOF >> /etc/hosts.deny ALL : ALL EOF # # Installation des vmware tools # /bin/mkdir -p /x/TOOLS cd /x/TOOLS /usr/bin/wget http://myvm.epfl.ch/pub/VMwareTools-3.0.1-41412.i386.rpm /bin/cp /etc/yum.conf /etc/yum-nongpgcheck.conf /usr/bin/perl -i.trash -e 'while(<>){s/^gpgcheck=1/gpgcheck=0/g ; print ;}' /etc/yum-nongpgcheck.conf /bin/rm /etc/yum-nongpgcheck.trash /usr/bin/yum -y -c /etc/yum-nongpgcheck.conf localinstall VMwareTools-3.0.1-41412.i386.rpm ##/usr/bin/vmware-config-tools.pl << EOF ##y... ##/usr/linux/include ##yes ##... ##EOF ### On pourra le configurer quand on aura les vmware tools installés