diff --git a/templates/CentOS-5.6-x86_64-netboot/definition.rb b/templates/CentOS-5.6-x86_64-netboot/definition.rb new file mode 100644 index 00000000..c00e787a --- /dev/null +++ b/templates/CentOS-5.6-x86_64-netboot/definition.rb @@ -0,0 +1,16 @@ +Veewee::Session.declare({ + :cpu_count => '1', :memory_size=> '384', + :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on', + :os_type_id => 'RedHat_64', + :iso_file => "CentOS-5.6-x86_64-netinstall.iso", + :iso_src => "http://mirror.ukhost4u.com/centos/5.6/isos/x86_64/CentOS-5.6-x86_64-netinstall.iso", + :iso_md5 => "02cf3a5e32aaa5eed27af775ad292beb", + :iso_download_timeout => 1000, + :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg' ], + :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", + :ssh_host_port => "7222", :ssh_guest_port => "22", + :sudo_cmd => "echo '%p'|sudo -S sh '%f'", + :shutdown_cmd => "/sbin/halt -h -p", + :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000 +}) diff --git a/templates/CentOS-5.6-x86_64-netboot/ks.cfg b/templates/CentOS-5.6-x86_64-netboot/ks.cfg new file mode 100644 index 00000000..339a880f --- /dev/null +++ b/templates/CentOS-5.6-x86_64-netboot/ks.cfg @@ -0,0 +1,45 @@ +# Kickstart file automatically generated by anaconda. + +install +url --url=http://mirror.bytemark.co.uk/centos/5.6/os/x86_64 +lang en_US.UTF-8 +langsupport --default=en_US.UTF-8 en_US.UTF-8 +keyboard us +xconfig --card "VMWare" --videoram 16384 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16 +network --device eth0 --bootproto dhcp +rootpw --iscrypted $1$vSG8FjAu$ekQ0grf16hS4G93HTPcco/ +firewall --enabled --trust eth0 --ssh +selinux --enforcing +authconfig --enableshadow --enablemd5 +timezone Europe/London +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 --initlabel +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=528 --grow --maxsize=1056 +logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow +reboot + +%packages +#@ admin-tools +#@ text-internet +#@ dialup +#@ smb-server +#@ web-server +#@ printing +#@ server-cfg +@ core +grub +e2fsprogs +lvm2 + +%post +/usr/sbin/groupadd vagrant +/usr/sbin/useradd vagrant -g vagrant -G wheel +echo "vagrant"|passwd --stdin vagrant +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers diff --git a/templates/CentOS-5.6-x86_64-netboot/postinstall.sh b/templates/CentOS-5.6-x86_64-netboot/postinstall.sh new file mode 100644 index 00000000..c96a068b --- /dev/null +++ b/templates/CentOS-5.6-x86_64-netboot/postinstall.sh @@ -0,0 +1,58 @@ +#http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/ + +fail() +{ + echo "FATAL: $*" + exit 1 +} + +#kernel source is needed for vbox additions +yum -y install gcc bzip2 make kernel-devel-`uname -r` +#yum -y update +#yum -y upgrade + +yum -y install gcc-c++ zlib-devel openssl-devel readline-devel sqlite3-devel +yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts +yum -y clean all + +#Installing ruby +cd /tmp +wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz || fail "Could not download Ruby source" +tar xzvf ruby-1.9.2-p180.tar.gz +cd ruby-1.9.2-p180 +./configure +make && make install +cd /tmp +rm -rf /tmp/ruby-1.9.2-p180 +rm /tmp/ruby-1.9.2-p180.tar.gz +ln -s /usr/local/bin/ruby /usr/bin/ruby # Create a sym link for the same path +ln -s /usr/local/bin/gem /usr/bin/gem # Create a sym link for the same path + +#Installing chef & Puppet +echo "Installing chef and puppet" +/usr/local/bin/gem install chef --no-ri --no-rdoc || fail "Could not install chef" +/usr/local/bin/gem install puppet --no-ri --no-rdoc || fail "Could not install puppet" + +#Installing vagrant keys +mkdir /home/vagrant/.ssh +chmod 700 /home/vagrant/.ssh +cd /home/vagrant/.ssh +wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys +chown -R vagrant /home/vagrant/.ssh + +#Installing the virtualbox guest additions +VBOX_VERSION=$(cat /home/vagrant/.vbox_version) +cd /tmp +wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso +mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt +sh /mnt/VBoxLinuxAdditions.run +umount /mnt + +rm VBoxGuestAdditions_$VBOX_VERSION.iso + + +sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers + +#poweroff -h + +exit