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 Oracle Linux 5.11 i386 & x86_64 templates #1052

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Base install

source ./proxy.sh

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

wget http://public-yum.oracle.com/public-yum-el5.repo -O /etc/yum.repos.d/public-yum-el5.repo

cd /tmp
wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
rm -f /tmp/epel-release-5-4.noarch.rpm
# Not flexible to switch between direct Internet access and behind firewall
# --httpproxy HOST --httpport PORT
# rpm -ivh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

echo "UseDNS no" >> /etc/ssh/sshd_config

sed -i "s/^HOSTNAME=.*/HOSTNAME=oracle.vagrantup.com/" /etc/sysconfig/network
3 changes: 3 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/chef.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install Chef
source ./proxy.sh
curl -L https://www.opscode.com/chef/install.sh | bash
8 changes: 8 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
yum -y remove gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
yum -y clean all

# rm -rf /etc/yum.repos.d/{puppetlabs,epel,epel-testing}.repo # keep
rm -rf VBoxGuestAdditions_*.iso

# Remove traces of mac address from network configuration
sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0
37 changes: 37 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/definition.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Veewee::Session.declare({
:cpu_count => '1',
:memory_size=> '480',
:disk_size => '10140',
:disk_format => 'VDI',
:hostiocache => 'on',
:os_type_id => 'Oracle',
:iso_file => "Enterprise-R5-U11-Server-i386-dvd.iso",
:iso_src => "http://mirrors.dotsrc.org/oracle-linux/EL5/U11/i386/Enterprise-R5-U11-Server-i386-dvd.iso",
:iso_md5 => "f4ef2b868a0cccb736664136eca798ec",
:iso_download_timeout => 10000,
:boot_wait => "10",
:boot_cmd_sequence => [ 'linux 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 => [
"proxy.sh",
"base.sh",
"ruby.sh",
"chef.sh",
"puppet.sh",
"vagrant.sh",
"virtualbox.sh",
"cleanup.sh",
"zerodisk.sh"
],
:postinstall_timeout => 10000
})
55 changes: 55 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
install
cdrom
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp
rootpw vagrant
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone UTC
bootloader --location=mbr
text
skipx

zerombr
clearpart --all --initlabel
autopart

firstboot --disabled
reboot

%packages --ignoremissing
@core
wget
curl
make
gcc
gcc-c++
kernel-devel
kernel-uek-devel
kernel-headers
zlib-devel
openssl-devel
readline-devel
sqlite-devel
perl
bzip2
dkms
net-tools
bind-utils
nfs-utils
bash-completion
deltarpm
yum-utils
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware

%post --log=/root/ks-postinstall.log
/usr/bin/yum -y install sudo
/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
%end
6 changes: 6 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set proxy for machines behind firewall
# export http_proxy=""
# export https_proxy=""
# export ftp_proxy=""
# All in one line
# export {http,https,ftp}_proxy=""
3 changes: 3 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/puppet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install Puppet
source ./proxy.sh
gem install --no-ri --no-rdoc puppet
36 changes: 36 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Install Ruby from source

source ./proxy.sh

RUBY_VERSION="ruby-1.9.3-p551"
RUBY_SOURCE="http://cache.ruby-lang.org/pub/ruby/${RUBY_VERSION}.tar.gz"
LIBYAML_VERSION="yaml-0.1.6"
LIBYAML_SOURCE="http://pyyaml.org/download/libyaml/${LIBYAML_VERSION}.tar.gz"

yum install -y readline-devel ncurses-devel gdbm-devel tcl-devel \
openssl-devel db4-devel byacc libyaml-devel libffi-devel make

# Install libyaml from source
cd /tmp
wget $LIBYAML_SOURCE
tar zxf ${LIBYAML_VERSION}.tar.gz
cd $LIBYAML_VERSION
./configure
make && make install

cd /tmp
wget $RUBY_SOURCE
tar zxf ${RUBY_VERSION}.tar.gz
cd $RUBY_VERSION
./configure
make && make install
cd /tmp
rm -rf $RUBY_VERSION
rm /tmp/${RUBY_VERSION}.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

# Needed if Ruby is compiled from source
cat > /etc/profile.d/local.sh<<'EOF'
export PATH=$PATH:/usr/local/sbin:/usr/local/bin
EOF
21 changes: 21 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Vagrant specific

source ./proxy.sh

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
chmod 0440 /etc/sudoers.d/vagrant

# Installing vagrant keys
mkdir -pm 700 /home/vagrant/.ssh
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh

# Customize the message of the day
echo 'Welcome to Veewee built Vagrant Base Box.' > /etc/motd
8 changes: 8 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/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
3 changes: 3 additions & 0 deletions templates/OracleLinux-5.11-i386-DVD/zerodisk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
19 changes: 19 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Base install

source ./proxy.sh

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

wget http://public-yum.oracle.com/public-yum-el5.repo -O /etc/yum.repos.d/public-yum-el5.repo

cd /tmp
wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
rm -f /tmp/epel-release-5-4.noarch.rpm
# Not flexible to switch between direct Internet access and behind firewall
# --httpproxy HOST --httpport PORT
# rpm -ivh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

echo "UseDNS no" >> /etc/ssh/sshd_config

sed -i "s/^HOSTNAME=.*/HOSTNAME=oracle.vagrantup.com/" /etc/sysconfig/network
3 changes: 3 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/chef.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install Chef
source ./proxy.sh
curl -L https://www.opscode.com/chef/install.sh | bash
8 changes: 8 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
yum -y remove gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
yum -y clean all

# rm -rf /etc/yum.repos.d/{puppetlabs,epel,epel-testing}.repo # keep
rm -rf VBoxGuestAdditions_*.iso

# Remove traces of mac address from network configuration
sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0
37 changes: 37 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/definition.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Veewee::Session.declare({
:cpu_count => '1',
:memory_size=> '480',
:disk_size => '10140',
:disk_format => 'VDI',
:hostiocache => 'on',
:os_type_id => 'Oracle_64',
:iso_file => "Enterprise-R5-U11-Server-x86_64-dvd.iso",
:iso_src => "http://mirrors.dotsrc.org/oracle-linux/EL5/U11/x86_64/Enterprise-R5-U11-Server-x86_64-dvd.iso",
:iso_md5 => "8af2121088c7e6f5ebdb6d5900403240",
:iso_download_timeout => 10000,
:boot_wait => "10",
:boot_cmd_sequence => [ 'linux 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 => [
"proxy.sh",
"base.sh",
"ruby.sh",
"chef.sh",
"puppet.sh",
"vagrant.sh",
"virtualbox.sh",
"cleanup.sh",
"zerodisk.sh"
],
:postinstall_timeout => 10000
})
55 changes: 55 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
install
cdrom
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp
rootpw vagrant
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone UTC
bootloader --location=mbr
text
skipx

zerombr
clearpart --all --initlabel
autopart

firstboot --disabled
reboot

%packages --ignoremissing
@core
wget
curl
make
gcc
gcc-c++
kernel-devel
kernel-uek-devel
kernel-headers
zlib-devel
openssl-devel
readline-devel
sqlite-devel
perl
bzip2
dkms
net-tools
bind-utils
nfs-utils
bash-completion
deltarpm
yum-utils
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware

%post --log=/root/ks-postinstall.log
/usr/bin/yum -y install sudo
/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
%end
6 changes: 6 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set proxy for machines behind firewall
# export http_proxy=""
# export https_proxy=""
# export ftp_proxy=""
# All in one line
# export {http,https,ftp}_proxy=""
3 changes: 3 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/puppet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install Puppet
source ./proxy.sh
gem install --no-ri --no-rdoc puppet
36 changes: 36 additions & 0 deletions templates/OracleLinux-5.11-x86_64-DVD/ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Install Ruby from source

source ./proxy.sh

RUBY_VERSION="ruby-1.9.3-p551"
RUBY_SOURCE="http://cache.ruby-lang.org/pub/ruby/${RUBY_VERSION}.tar.gz"
LIBYAML_VERSION="yaml-0.1.6"
LIBYAML_SOURCE="http://pyyaml.org/download/libyaml/${LIBYAML_VERSION}.tar.gz"

yum install -y readline-devel ncurses-devel gdbm-devel tcl-devel \
openssl-devel db4-devel byacc libyaml-devel libffi-devel make

# Install libyaml from source
cd /tmp
wget $LIBYAML_SOURCE
tar zxf ${LIBYAML_VERSION}.tar.gz
cd $LIBYAML_VERSION
./configure
make && make install

cd /tmp
wget $RUBY_SOURCE
tar zxf ${RUBY_VERSION}.tar.gz
cd $RUBY_VERSION
./configure
make && make install
cd /tmp
rm -rf $RUBY_VERSION
rm /tmp/${RUBY_VERSION}.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

# Needed if Ruby is compiled from source
cat > /etc/profile.d/local.sh<<'EOF'
export PATH=$PATH:/usr/local/sbin:/usr/local/bin
EOF
Loading