diff --git a/templates/CentOS-6.0-i386-netboot/definition.rb b/templates/CentOS-6.0-i386-netboot/definition.rb new file mode 100644 index 00000000..48846436 --- /dev/null +++ b/templates/CentOS-6.0-i386-netboot/definition.rb @@ -0,0 +1,16 @@ +Veewee::Session.declare({ + :cpu_count => '1', :memory_size=> '392', + :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on', + :os_type_id => 'RedHat', + :iso_file => "CentOS-6.0-i386-netinstall.iso", + :iso_src => "http://be.mirror.eurid.eu/centos/6.0/isos/i386/CentOS-6.0-i386-netinstall.iso", + :iso_md5 => "65731c29c49630dea6cde103d02ccffb", + :iso_download_timeout => 1000, + :boot_wait => "15", :boot_cmd_sequence => [ ' 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 => "7223", :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-6.0-i386-netboot/ks.cfg b/templates/CentOS-6.0-i386-netboot/ks.cfg new file mode 100644 index 00000000..e922aafd --- /dev/null +++ b/templates/CentOS-6.0-i386-netboot/ks.cfg @@ -0,0 +1,36 @@ +install +url --url=http://be.mirror.eurid.eu/centos/6.0/os/i386/ +lang en_US.UTF-8 +keyboard us + +network --bootproto dhcp +rootpw --iscrypted $1$vSG8FjAu$ekQ0grf16hS4G93HTPcco/ +firewall --enabled --trust eth0 --ssh +selinux --disabled +timezone Europe/Brussels +bootloader --location=mbr + +text +skipx +zerombr + +clearpart --all --initlabel +autopart + +authconfig --enableshadow --enablemd5 +firstboot --disabled +reboot + +repo --name=epel --baseurl=http://download.fedora.redhat.com/pub/epel/6/i386/ + +%packages +@ 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-6.0-i386-netboot/postinstall.sh b/templates/CentOS-6.0-i386-netboot/postinstall.sh new file mode 100644 index 00000000..3b8d465f --- /dev/null +++ b/templates/CentOS-6.0-i386-netboot/postinstall.sh @@ -0,0 +1,44 @@ +#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 ruby ruby-devel rubygems +yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts +yum -y clean all + +#Installing chef & Puppet +echo "Installing chef and puppet" +gem install puppet chef --no-ri --no-rdoc + +#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