# Kickstart file for Puppet on CentOS 4/RedHat ES-4 # Tested on ES-4 U8 / CentOS 4.8 # May work on older enterprise 4 systems. # # Adam Reid # http://github.com/adamreid/kickstarts/puppet-es4-ks.cfg install cdrom lang en_US.UTF-8 langsupport --default=en_US.UTF-8 en_US.UTF-8 keyboard us xconfig --card "VESA driver (generic)" --videoram 12288 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16 network --device eth0 --bootproto dhcp rootpw vagrant firewall --disabled selinux --disabled authconfig --enableshadow --passalgo=md5 timezone --utc America/New_York bootloader --location=mbr # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work clearpart --all --drives=sda part /boot --fstype ext3 --size=100 --ondisk=sda part pv.2 --size=0 --grow --ondisk=sda volgroup VolGroup00 --pesize=32768 pv.2 logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=512 --grow --maxsize=1024 logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow %packages lvm2 kernel e2fsprogs grub # required to build ruby # should be kept for gems that build native extensions. automake gcc cpp glibc-devel glibc-headers glibc-kernheaders glibc glibc-common libgcc # required to build ruby bindings, can be removed after zlib-devel openssl-devel readline-devel %post # Change to a vt to see progress exec < /dev/tty3 > /dev/tty3 chvt 3 # redirect output to ks-post.log including stdout and stderr ( ####################################################### # Build Ruby ####################################################### # Keep it clean mkdir /tmp/ruby cd /tmp/ruby # autoconf 2.60 is required to build ruby wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz tar -xzf autoconf-2.60.tar.gz cd autoconf-2.60 ./configure --prefix=/usr && make && make install cd /tmp/ruby # build ruby-1.8.7-p358 wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p358.tar.bz2 tar -xjf ruby-1.8.7-p358.tar.bz2 cd ruby-1.8.7-p358 autoconf ./configure --prefix=/usr && make && make install cd /tmp/ruby # install ruby-gems 1.8.10 wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz tar -xzf rubygems-1.8.10.tgz cd rubygems-1.8.10 /usr/bin/ruby setup.rb # clean up cd / rm -rf /tmp/ruby ####################################################### # Install Puppet ####################################################### gem install puppet --no-rdoc --no-ri # add the puppet group groupadd puppet ####################################################### # Install VirtualBox Guest Additions # # Note: You will need to provide a copy of the # VirtualBoX Guest Addititons iso on a web service # I use python -m 'http.server' in # /usr/lib/virtualbox/additions to serve it. ####################################################### cd /tmp wget http://192.168.1.3:8000/VBoxGuestAdditions.iso mkdir /tmp/isomount mount -t iso9660 -o loop /tmp/VBoxGuestAdditions.iso /tmp/isomount /tmp/isomount/VBoxLinuxAdditions.run umount isomount rm VBoxGuestAdditions.iso ####################################################### # Turn off un-needed services ####################################################### chkconfig sendmail off chkconfig vbox-add-x11 off chkconfig smartd off chkconfig ntpd off chkconfig cupsd off ####################################################### # Setup for Vagrant ####################################################### groupadd admin useradd -g admin vagrant echo 'Defaults env_keep="SSH_AUTH_SOCK"' >> /etc/sudoers echo '%admin ALL=NOPASSWD: ALL' >> /etc/sudoers # Add vagrant insecure private key for key auth # Make your own if this is private. # See http://vagrantup.com/docs/base_boxes.html mkdir /home/vagrant/.ssh echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > /home/vagrant/.ssh/authorized_keys # Clean up unused disk space so compressed image is smaller. cat /dev/zero > /tmp/zero.fill rm /tmp/zero.fill ####################################################### # The system can now be packaged with # `vagrant package VMNAME` ####################################################### echo 'You can now package this box with `vagrant package VMNAME`' ) 2>&1 | /usr/bin/tee /root/ks-post.log # switch back to gui chvt 7