1 of 13

Vagrant

2 of 13

何に使うの?

仮想マシンにOSをインストールするが楽になります。

3 of 13

何に使うの?

サーバーの設定を行うスクリプトを試す環境を作る時に、あると便利そう

手軽に作って手軽に試せる・・・かもしれない

4 of 13

仮想マシンを準備する上での問題点

・ISOを準備するのが面倒

・OSのインストーラーを実行するのが面倒

 (OSごとに使い方が違うので)

・同じ作業を何回もするのが苦痛

5 of 13

6 of 13

初期設定

$ gem install vagrant

$ gem install veewee

7 of 13

VirtualBoxをインストール

http://www.oracle.com/technetwork/jp/server-storage/virtualbox/downloads/index.html

8 of 13

VagrantBoxの雛形を作成

ディレクトリを適当に作成

$ mkdir ~/vagrant

$ cd vagrant

初期化

$ vagrant init

9 of 13

VagrantBoxの雛形を作成

OSのテンプレートの一覧を表示

$ vagrant basebox templates

10 of 13

VagrantBoxの雛形を作成

CentOSのOSテンプレートを作ってみる

$ vagrant basebox define centos6_2 'CentOS-6.2-x86_64-minimal'

$ vagrant basebox build centos6_2

11 of 13

作り終わったらVagrantBoxを登録

$ vagrant package --base 'centos6_2' --output 'centos6_2.box'

$ vagrant box add 'centos6_2' 'centos6_2.box'

12 of 13

登録したVargrantBoxを使ってみる

$ cd ~

$ mkdir centos_test

$ cd centos_test

$ vagrant init 'centos6_2'

$ vagrant up

$ vagrant ssh

13 of 13

今後の予定

Capistranoとか

Chefとかで

ミドルウェアのインストールや設定も自動化

などできたらいいな。。。