Skip to content

Commit

Permalink
Merge pull request #229 from arioch/CentOS-6.2-x86_64-minimal-split
Browse files Browse the repository at this point in the history
CentOS 6.2 x86_64 minimal refactor
  • Loading branch information
jedi4ever committed Feb 7, 2012
2 parents 485a42b + cb27eb5 commit 1e28e64
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 62 deletions.
14 changes: 14 additions & 0 deletions templates/CentOS-6.2-x86_64-minimal/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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 wget

3 changes: 3 additions & 0 deletions templates/CentOS-6.2-x86_64-minimal/chef.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install Chef
gem install --no-ri --no-rdoc chef

5 changes: 5 additions & 0 deletions templates/CentOS-6.2-x86_64-minimal/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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

40 changes: 32 additions & 8 deletions templates/CentOS-6.2-x86_64-minimal/definition.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
Veewee::Session.declare({
:cpu_count => '1', :memory_size=> '512',
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
:cpu_count => '1',
:memory_size=> '480',
:disk_size => '10140',
:disk_format => 'VDI',
:hostiocache => 'off',
:os_type_id => 'RedHat_64',
:iso_file => "CentOS-6.2-x86_64-minimal.iso", :iso_src => "http://mirror.internode.on.net/pub/centos/6.2/isos/x86_64/CentOS-6.2-x86_64-minimal.iso", :iso_md5 => "20dac370a6e08ded2701e4104855bc6e", :iso_download_timeout => 1000,
:boot_wait => "10", :boot_cmd_sequence => [
:iso_file => "CentOS-6.2-x86_64-minimal.iso",
:iso_src => "http://centos.weepeetelecom.be/6.2/isos/x86_64/CentOS-6.2-x86_64-minimal.iso",
:iso_md5 => "20dac370a6e08ded2701e4104855bc6e",
: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",
: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 => [ "postinstall.sh"], :postinstall_timeout => 10000
:postinstall_files => [
"base.sh",
"ruby.sh",
"chef.sh",
"puppet.sh",
"vagrant.sh",
"virtualbox.sh",
#"kvm.sh",
#"vmfusion.sh",
"cleanup.sh"
],
:postinstall_timeout => 10000
})
9 changes: 5 additions & 4 deletions templates/CentOS-6.2-x86_64-minimal/ks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ bzip2

%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
/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

50 changes: 0 additions & 50 deletions templates/CentOS-6.2-x86_64-minimal/postinstall.sh

This file was deleted.

12 changes: 12 additions & 0 deletions templates/CentOS-6.2-x86_64-minimal/puppet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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

3 changes: 3 additions & 0 deletions templates/CentOS-6.2-x86_64-minimal/ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install Ruby
yum -y install ruby ruby-devel rubygems

16 changes: 16 additions & 0 deletions templates/CentOS-6.2-x86_64-minimal/vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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.2-x86_64-minimal/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
mount -o loop /home/veewee/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm -rf /home/veewee/VBoxGuestAdditions_*.iso

0 comments on commit 1e28e64

Please sign in to comment.