keijikk
3/7/2016 - 7:15 AM

CentOS6:VagrantFile From http://qiita.com/seri_k/items/b52106973c0649cc68b3

#!/bin/sh

# 同じくvagrantユーザーで実行する想定。
if [ ! -e '/home/vagrant/.rbenv/plugins/ruby-build' ]; then
    sudo yum -y install openssl-devel
    sudo yum -y install ImageMagick-devel
    sudo yum -y install libxml2-devel
    sudo yum -y install libxslt-devel

    echo 'gem: --no-ri --no-rdoc' > ~/.gemrc

    source ~/.bashrc
    git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
    rbenv install 2.0.0-p481
    rbenv global 2.0.0-p481

    git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
    gem install bundler
    gem install reditor
    gem install execjs
fi
#!/bin/sh

# グローバルに使える必要はないのでvagrantユーザーで実行する想定。
if [ ! -e '/home/vagrant/.rbenv' ]; then
    sudo yum -y install gcc-c++
    sudo yum -y install openssl-devel
    sudo yum -y install git
    git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
    echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
    exec $SHELL -l
fi
 vagrant reload --provision
#!/bin/sh

service iptables stop
chkconfig iptables off

rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm

# セキュリティーに関するパッケージだけアップデートする
# セキュリティーに関係なくアップデートするなら yum update
yum -y install yum-plugin-security
yum -y --security update

yum install -y vim

echo << TIME > /etc/sysconfig/clock
ZONE="Asia/Tokyo"
UTC="false"
TIME
source /etc/sysconfig/clock
/bin/cp -f /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
# privileged => trueはrootユーザーとして実行するためのオプションです。
config.vm.provision :shell, :path => "./provision-script/basic-setting.sh",:privileged   => true