Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for CentOS-6.1-x86_64-netboot #226

Merged
merged 1 commit into from
Feb 7, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Base install

sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers

cat > /etc/yum.repos.d/epel.repo << EOM
[epel]
name=epel
baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch
enabled=1
gpgcheck=0
EOM

yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl
2 changes: 2 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/chef.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Install Chef
gem install --no-ri --no-rdoc chef
4 changes: 4 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
yum -y erase gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
yum -y clean all
rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo
rm -rf VBoxGuestAdditions_*.iso
39 changes: 39 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/definition.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Veewee::Definition.declare({
:cpu_count => '1',
:memory_size=> '480',
:disk_size => '10140',
:disk_format => 'VDI',
:hostiocache => 'off',
:ioapic => 'on',
:pae => 'on',
:os_type_id => 'RedHat_64',
:iso_file => "CentOS-6.1-x86_64-netinstall.iso",
:iso_src => "http://be.mirror.eurid.eu/centos/6.1/isos/x86_64/CentOS-6.1-x86_64-netinstall.iso",
:iso_md5 => "d13da95c29e585ee15cf403b89468243",
:iso_download_timeout => 1000,
:boot_wait => "15",
: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 => "10000",
:ssh_user => "veewee",
:ssh_password => "veewee",
: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 => [
"base.sh",
"ruby.sh",
"chef.sh",
"puppet.sh",
"vagrant.sh",
"virtualbox.sh",
#"kvm.sh",
#"vmfusion.sh",
"cleanup.sh"
],
:postinstall_timeout => 10000
})
44 changes: 44 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
install
url --url=http://be.mirror.eurid.eu/centos/6.1/os/x86_64/
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
firewall --enabled --trust eth0 --ssh
authconfig --enableshadow --enablemd5
selinux --disabled
timezone Europe/Brussels
bootloader --location=mbr

text
skipx
zerombr

clearpart --all --initlabel
autopart

auth --useshadow --enablemd5
firstboot --disabled
reboot

%packages
@ core
kernel-devel
gcc
gcc-c++
bzip2
make
zlib-devel
openssl-devel
readline-devel
sqlite-devel

-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware

%post
/usr/sbin/groupadd veewee
/usr/sbin/useradd veewee -g veewee -G wheel
echo "veewee"|passwd --stdin veewee
echo "veewee ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
48 changes: 48 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#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

cat > /etc/yum.repos.d/puppetlabs.repo << EOM
[puppetlabs]
name=puppetlabs
baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch
enabled=1
gpgcheck=0
EOM

cat > /etc/yum.repos.d/epel.repo << EOM
[epel]
name=epel
baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch
enabled=1
gpgcheck=0
EOM

yum -y install puppet facter ruby-devel rubygems
yum -y erase gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
yum -y clean all
rm /etc/yum.repos.d/{puppetlabs,epel}.repo

gem install --no-ri --no-rdoc chef

# Installing vagrant keys
mkdir /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
cd /home/vagrant/.ssh
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/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

dd if=/dev/zero of=/tmp/clean || rm /tmp/clean

exit
11 changes: 11 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/puppet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Install Puppet

cat > /etc/yum.repos.d/puppetlabs.repo << EOM
[puppetlabs]
name=puppetlabs
baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch
enabled=1
gpgcheck=0
EOM

yum -y install puppet facter
2 changes: 2 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Install Ruby
yum -y install ruby-devel rubygems
15 changes: 15 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Vagrant specific
date > /etc/vagrant_box_build_time

# Add vagrant user
/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

# Installing vagrant keys
mkdir -p /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
cd /home/vagrant/.ssh
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
chown -R vagrant /home/vagrant/.ssh
8 changes: 8 additions & 0 deletions templates/CentOS-6.1-x86_64-netboot/virtualbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Installing the virtualbox guest additions
VBOX_VERSION=$(cat /home/veewee/.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