Skip to content

Commit

Permalink
i386 のイメージに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon3 committed Dec 6, 2012
1 parent 0306711 commit f071a3e
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/dev-manual.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

Vagrant で Base box を作成
----------
- veewee で CentOS-6.3-x86_64-minimal をベースに作成
- https://dl.dropbox.com/u/1981687/CentOS-6.3-x86_64-minimal-ja.box
- veewee で CentOS-6.3-i386-minimal をベースに作成
- https://dl.dropbox.com/u/1981687/CentOS-6.3-i386-minimal-ja.box


仮想アプライアンス作成用の VM を Vagrant で起動
Expand Down
4 changes: 2 additions & 2 deletions vagrant/base/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Vagrant::Config.run do |config|
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "CentOS-6.3-x86_64-minimal-ja"
config.vm.box = "CentOS-6.3-i386-minimal-ja"

# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
# config.vm.box_url = "http://domain.com/path/to/above.box"
config.vm.box_url = "https://dl.dropbox.com/u/1981687/CentOS-6.3-x86_64-minimal-ja.box"
config.vm.box_url = "https://dl.dropbox.com/u/1981687/CentOS-6.3-i386-minimal-ja.box"

config.vm.customize ["modifyvm", :id, "--name", "perl-entrance-fukuoka"]

Expand Down
14 changes: 14 additions & 0 deletions veewee-definitions/CentOS-6.3-i386-minimal-ja/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 veewee-definitions/CentOS-6.3-i386-minimal-ja/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 veewee-definitions/CentOS-6.3-i386-minimal-ja/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: 40 additions & 0 deletions veewee-definitions/CentOS-6.3-i386-minimal-ja/definition.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Veewee::Session.declare({
:cpu_count => '1',
:memory_size=> '480',
:disk_size => '10140',
:disk_format => 'VDI',
:hostiocache => 'off',
:os_type_id => 'RedHat_64',
:iso_file => "CentOS-6.3-i386-minimal.iso",
:iso_src => "http://www.mirrorservice.org/sites/mirror.centos.org/6.3/isos/i386/CentOS-6.3-i386-minimal.iso",
:iso_md5 => "081ce8ba3e9f761a35d47f1c345562c1",
: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 => "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",
"zerodisk.sh"
],
:postinstall_timeout => 10000
})
42 changes: 42 additions & 0 deletions veewee-definitions/CentOS-6.3-i386-minimal-ja/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
install
cdrom
lang ja_JP.UTF-8
keyboard jp106
network --bootproto=dhcp
rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
firewall --enabled --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone Asia/Tokyo
bootloader --location=mbr

text
skipx
zerombr

clearpart --all --initlabel
autopart

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

%packages --ignoremissing
@core
bzip2
kernel-devel
kernel-headers
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
%end

%post
/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.d/veewee
chmod 0440 /etc/sudoers.d/veewee
%end

12 changes: 12 additions & 0 deletions veewee-definitions/CentOS-6.3-i386-minimal-ja/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 veewee-definitions/CentOS-6.3-i386-minimal-ja/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

18 changes: 18 additions & 0 deletions veewee-definitions/CentOS-6.3-i386-minimal-ja/vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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.d/vagrant
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 your Vagrant-built virtual machine.' > /etc/motd
8 changes: 8 additions & 0 deletions veewee-definitions/CentOS-6.3-i386-minimal-ja/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 veewee-definitions/CentOS-6.3-i386-minimal-ja/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

0 comments on commit f071a3e

Please sign in to comment.