Skip to content

Instantly share code, notes, and snippets.

@fishnix
Created July 11, 2012 15:52
Show Gist options
  • Select an option

  • Save fishnix/3091311 to your computer and use it in GitHub Desktop.

Select an option

Save fishnix/3091311 to your computer and use it in GitHub Desktop.
Veewee for rhel63
Veewee::Session.declare({
:cpu_count => '1', :memory_size=> '512',
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
:os_type_id => 'RedHat_64',
:iso_file => "rhel-server-6.3-x86_64-dvd.iso",
:iso_md5 => "d717af33dd258945e6304f9955487017", :iso_download_timeout => 1000,
:boot_wait => "10", :boot_cmd_sequence => [
'<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>'
],
: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
})
install
cdrom
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp
rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
firewall --disabled --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone UTC
bootloader --location=mbr
text
skipx
zerombr
clearpart --all --initlabel
autopart
auth --useshadow --enablemd5
firstboot --disabled
reboot
%packages --ignoremissing
@core
bzip2
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
%post
/usr/bin/yum -y install sudo
/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
http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
date > /etc/vagrant_box_build_time
## Register local satellite
echo 'Pulling local satellite cert'
cd /usr/share/rhn/ && /usr/bin/wget http://vm-satprdapp-01.its.yale.edu/pub/RHN-ORG-TRUSTED-SSL-CERT
echo 'Modifying RHN configuration'
# Change RHN configuration
/bin/sed -i \
-e 's/serverURL=.*$/serverURL=https:\/\/vm-satprdapp-01\.its\.yale\.edu\/XMLRPC/' \
-e 's/sslCACert=.*$/sslCACert=\/usr\/share\/rhn\/RHN-ORG-TRUSTED-SSL-CERT/' \
/etc/sysconfig/rhn/up2date
echo 'Running: register on Yale Satellite'
/etc/init.d/messagebus start
/etc/init.d/haldaemon start
/usr/sbin/rhnreg_ks --norhnsd --activationkey ###### ACTIVATION KEY #########
/etc/init.d/haldaemon stop
/etc/init.d/messagebus stop
yum -y install gcc make gcc-c++ ruby ruby-devel kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget
yum -y clean all
cd /tmp && wget "http://production.cf.rubygems.org/rubygems/rubygems-1.8.17.tgz" && tar -zxvf rubygems*
cd /tmp/rubygems-1.8.17 && ruby ./setup.rb
gem update --system
gem update
gem install --no-ri --no-rdoc chef
# Installing vagrant keys
mkdir /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
cd /home/vagrant/.ssh
curl -L -o authorized_keys https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub
chown -R vagrant /home/vagrant/.ssh
# Installing the virtualbox guest additions
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
curl -L -o VBoxGuestAdditions_$VBOX_VERSION.iso 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
dd if=/dev/zero of=/tmp/clean || rm /tmp/clean
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment