massの日記

日々の薪

るびまの記事を読んでChefを使ってみた

先月から新しい開発チームに所属し、個人開発環境はローカルのVMという状況になった。
開発マシンのセットアップ手順はRedmineのwikiに書かれているから、それに従って環境を構築していくというよくあるケース。

環境を構築しようとしたけど、wikiに手順がまとめられているならその手順を自動化しとけばいいじゃないと考え、最近色々なところでみたChefというツールを使ってみることを決意。

るびまChef でサーバ管理を楽チンにしよう! (第 1 回)という記事を見つけたので、
これを読んでみたところ、下記のような理解に落ち着いた。

Chefはサーバの構成管理ツール、サーバを構築する際に、まずは構成の設定ファイルを作成し、設定ファイルに従ってサーバを構築してくれ、サーバ内の構成を保ってくれる。

複数台のサーバはもちろん、個人開発環境など、繰り返し同じことを行う場合は、こういったツールで一度設定ファイルを作成し、一度作ったら後はツールの方でよしなに構築してくれる方が嬉しい。

同じようなツールでPuppetがあるけれど、これとどちらを使うか悩んでいたところ上述のるびまの記事にあった、PuppetとChefの比較をみて設定ファイルの書きやすさからChefを使うことにした。
f:id:johnsmith0707:20120502130133p:plain

そんなわけで、Chefを使う方向で固まり、るびまの記事とオフィシャルのドキュメントを読み進めていく。
るびまの記事を読んでからChefのオフィシャルページを読んだところ、Chefでは3つの役割が内部で分担されていることがわかった。一つ目はChefサーバ、二つ目はNodeサーバ、三つ目はWorkstation、という役割。
f:id:johnsmith0707:20120502131049p:plain

Chefサーバは構成設定ファイルが配置されているサーバ、Nodeサーバは構成設定ファイルにより構築されたサーバ、WorkStationは構成設定ファイルの変更をChefサーバに反映する環境。Chefサーバは1台、NodeサーバはX台、Workstationは最低1台、となる形。この形がChefの基本形となる。

この3つ役割分担はChefを使う上での基本であるが、今回自分が作ろうとした開発環境のように1台のセットアップを自動化する場合にはChefサーバを立てる必要はなく、Chef-Soloという1台構成用の使い方が存在する。るびまの記事にあった図を拝借すると下記のような形になる。

f:id:johnsmith0707:20120502130959p:plain


さて、今までさんざん出てきた構成設定ファイルだが、どんな構成になっているのかというと、Cookbookという名前で構成設定ファイルのセットが用意されている。
Cookbookのセットは下記のようなファイル構成となっている。

f:id:johnsmith0707:20120502133403p:plain

※オフィシャルを見たところ若干違う?以下抜粋。
A cookbook is a collection of recipe, resource definition, attribute, library, cookbook file and template files that chef uses to configure a system, plus metadata.

実際Cookbookを作ってみたところCookbookの構成はおおむねオフィシャルにかかれている通りだった。

vagrant@ubuntu-oneiric:~/chef-repo/cookbooks/php$ pwd /home/vagrant/chef-repo/cookbooks/php
vagrant@ubuntu-oneiric:~/chef-repo/cookbooks/php$ ls
attributes  definitions  files  libraries  metadata.rb  providers  README.md  recipes  resources  templates

ファイルの関係性をみると↓のような形になる。
f:id:johnsmith0707:20120502133729p:plain


最初のcookbookはるびまの記事写経ということで、rakeタスクでcookbookを作成したが、今ではknifeといわれるツールが主流の模様。長くなったが、ここから環境の構築が始まる。

環境:VirtualBox with Vagrant /OS:ubuntu 11.10 server amd64
まずは今回の作業で必要となるgit、rakeをgemでいれる。chef自身は既にインストールされているのでインストールの必要はないのでupdateのみとする。

$ sudo apt-get install git
$ sudo gem install rake
$ sudo gem update chef
$ sudo apt-get install emacs

まずはchef-repo(ひな形ディレクトリ)をcloneして、rakeタスクからcookbookを作成する。目標としては今回手動でいれたもの(git,rake,emacs)を自動でさくっと入れられるようにする。このためホストマシンとの共有ディレクトリ(/vagrant_data)にディレクトリを作成する。

$ cd /vagrant_data
$ git clone git://github.com/opscode/chef-repo.git
$ cd chef-repo
$ rake new_cookbook COOKBOOK=git
$ emacs cookbooks/git/recipes/default.rb

ファイルの中身は下記のような感じ。オフィシャルの説明を参考に書いてみた。今回はpackageから入れるので下記の形。

apt_package 'git' do
  action :install
end

続けてrakeも。

$ rake new_cookbook COOKBOOK=rake
$ emacs cookbooks/rake/recipes/default.rb
gem_package 'rake' do
  action :install
end

次はchef。

$ rake new_cookbook COOKBOOK=chef
$ emacs cookbooks/chef/recipes/default.rb
gem_package 'chef' do
  action :upgrade
end

最後にemacs.

$ rake new_cookbook COOKBOOK=emacs
$ emacs cookbooks/chef/recipes/default.rb
apt_package 'emacs' do
  action :install
end

とここまでは作成したのが、最後にcookbookへのパスを通すのとchefのログレベルの設定を行う必要がある。solo.rb、chef.jsonの2ファイルを用意する。これらのどこに置くかというと、自分でパスを設定できるので、どこでもいいが、個人的にはchefを使うユーザの$HOMEが良さそうだと感じた。
しかし、今回はvagrantのホストマシンとの共有ディレクトリに配置したいため、仮想マシンとホストマシンの共有ディレクトリである/vagrant_dataに配置。
どうせならこのファイルの作成も自動化したい!なので、先ほど作成したchefのレシピに下記を追記。

template "/vagrant_data/solo.rb" do
  owner "vagrant"
  group "vagrant"
  mode "0744"
end

template "/vagrant_data/chef.json" do
  owner "vagrant"
  group "vagrant"
  mode "0744"
end

ファイルの中身は↓のような形。

# solo.rb
file_cache_path "/tmp/chef-solo"
cookbook_path "/vagrant_data/chef-repo/cookbooks"
log_level :debug
# chef.json
{
    "run_list": [
       "recipe[git]","recipe[rake]","recipe[chef]","recipe[emacs]"
    ]
}

各cookbookとsolo.rbとchef.jsonができたのでいよいよ別のマシンでやってみよう!ということで、ホストマシンから新しいvirtualboxを立てて上記で作成したレシピファイルを移動。solo.rbとchef.jsonはそもそもchef-soloを叩く時に必要なのでtemplatesに入れておいても意味がないことにここで気づいた。死にたい。

# 新しいマシン
sudo chef-solo -c /vagrant_data/solo.rb -j /vagrant_data/chef.json

ずらずらーっとでてきた。

vagrant@ubuntu-oneiric:~$ sudo chef-solo -c /vagrant_data/solo.rb -j /vagrant_data/chef.json
[Wed, 09 May 2012 04:15:13 +0100] INFO: *** Chef 0.10.8 ***
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Building node object for ubuntu-oneiric
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Extracting run list from JSON attributes provided on command line
[Wed, 09 May 2012 04:15:13 +0100] INFO: Setting the run_list to ["recipe[git]", "recipe[rake]", "recipe[chef]", "recipe[emacs]"] from JSON
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Applying attributes from json file
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Platform is ubuntu version 11.10
[Wed, 09 May 2012 04:15:13 +0100] INFO: Run List is [recipe[git], recipe[rake], recipe[chef], recipe[emacs]]
[Wed, 09 May 2012 04:15:13 +0100] INFO: Run List expands to [git, rake, chef, emacs]
[Wed, 09 May 2012 04:15:13 +0100] INFO: Starting Chef Run for ubuntu-oneiric
[Wed, 09 May 2012 04:15:13 +0100] INFO: Running start handlers
[Wed, 09 May 2012 04:15:13 +0100] INFO: Start handlers complete.
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: No chefignore file found at /vagrant_data/chef-repo/cookbooks/chefignore no files will be ignored
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Loading Recipe git via include_recipe
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Found recipe default in cookbook git
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Loading Recipe rake via include_recipe
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Found recipe default in cookbook rake
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Loading Recipe chef via include_recipe
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Found recipe default in cookbook chef
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Loading Recipe emacs via include_recipe
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Found recipe default in cookbook emacs
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Loading from cookbook_path: /vagrant_data/chef-repo/cookbooks
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Converging node ubuntu-oneiric
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: Processing apt_package[git] on ubuntu-oneiric
[Wed, 09 May 2012 04:15:13 +0100] INFO: Processing apt_package[git] action install (git::default line 19)
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: apt_package[git] checking package status for git
[Wed, 09 May 2012 04:15:13 +0100] DEBUG: sh(apt-cache policy git)
git:
  Installed: (none)
  Candidate: 1:1.7.5.4-1
  Version table:
     1:1.7.5.4-1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
[Wed, 09 May 2012 04:15:15 +0100] DEBUG: apt_package[git] current version is nil
[Wed, 09 May 2012 04:15:15 +0100] DEBUG: apt_package[git] candidate version is 1:1.7.5.4-1
[Wed, 09 May 2012 04:15:15 +0100] DEBUG: Executing apt-get -q -y install git=1:1.7.5.4-1
[Wed, 09 May 2012 04:15:26 +0100] DEBUG: ---- Begin output of apt-get -q -y install git=1:1.7.5.4-1 ----
[Wed, 09 May 2012 04:15:26 +0100] DEBUG: STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  git-man liberror-perl
Suggested packages:
  git-doc git-el git-arch git-cvs git-svn git-email git-daemon-run git-gui
  gitk gitweb
The following NEW packages will be installed
  git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 5,347 kB of archives.
After this operation, 12.6 MB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main git-man all 1:1.7.5.4-1 [571 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main git amd64 1:1.7.5.4-1 [4,752 kB]
Fetched 5,347 kB in 5s (1,034 kB/s)
Selecting previously deselected package liberror-perl.
(Reading database ... 56417 files and directories currently installed.)
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously deselected package git-man.
Unpacking git-man (from .../git-man_1%3a1.7.5.4-1_all.deb) ...
Selecting previously deselected package git.
Unpacking git (from .../git_1%3a1.7.5.4-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.5.4-1) ...
Setting up git (1:1.7.5.4-1) ...
[Wed, 09 May 2012 04:15:26 +0100] DEBUG: STDERR: 
[Wed, 09 May 2012 04:15:26 +0100] DEBUG: ---- End output of apt-get -q -y install git=1:1.7.5.4-1 ----
[Wed, 09 May 2012 04:15:26 +0100] DEBUG: Ran apt-get -q -y install git=1:1.7.5.4-1 returned 0
[Wed, 09 May 2012 04:15:26 +0100] INFO: apt_package[git] installed version 1:1.7.5.4-1
[Wed, 09 May 2012 04:15:26 +0100] DEBUG: Processing gem_package[rake] on ubuntu-oneiric
[Wed, 09 May 2012 04:15:26 +0100] INFO: Processing gem_package[rake] action install (rake::default line 19)
[Wed, 09 May 2012 04:15:26 +0100] DEBUG: gem_package[rake] no installed version found for rake (>= 0)
[Wed, 09 May 2012 04:15:32 +0100] DEBUG:  found gem rake version 0.9.2.2 for platform ruby from http://rubygems.org/
Fetching: rake-0.9.2.2.gem (100%)
[Wed, 09 May 2012 04:15:33 +0100] INFO: gem_package[rake] installed version 0.9.2.2
[Wed, 09 May 2012 04:15:33 +0100] DEBUG: Processing gem_package[chef] on ubuntu-oneiric
[Wed, 09 May 2012 04:15:33 +0100] INFO: Processing gem_package[chef] action upgrade (chef::default line 19)
[Wed, 09 May 2012 04:15:33 +0100] DEBUG: gem_package[chef] found installed gem chef version 0.10.8 matching chef (>= 0)
Building native extensions.  This could take a while...
Fetching: ipaddress-0.8.0.gem (100%)
[Wed, 09 May 2012 04:15:57 +0100] INFO: gem_package[chef] upgraded from 0.10.8 to 
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: Processing template[/vagrant_data/solo.rb] on ubuntu-oneiric
[Wed, 09 May 2012 04:15:57 +0100] INFO: Processing template[/vagrant_data/solo.rb] action create (chef::default line 23)
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: Current content's checksum:  3b1ab7375d1a452432b9e667df95b0ac8710c13f01c9f0bfbac756c7866550e6
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: Rendered content's checksum: 3b1ab7375d1a452432b9e667df95b0ac8710c13f01c9f0bfbac756c7866550e6
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: template[/vagrant_data/solo.rb] content has not changed.
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: Processing template[/vagrant_data/chef.json] on ubuntu-oneiric
[Wed, 09 May 2012 04:15:57 +0100] INFO: Processing template[/vagrant_data/chef.json] action create (chef::default line 29)
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: Current content's checksum:  37ed952a3f583412c467103721d213b06caf363df9355137353c3950072a5f33
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: Rendered content's checksum: 37ed952a3f583412c467103721d213b06caf363df9355137353c3950072a5f33
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: template[/vagrant_data/chef.json] content has not changed.
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: Processing apt_package[emacs] on ubuntu-oneiric
[Wed, 09 May 2012 04:15:57 +0100] INFO: Processing apt_package[emacs] action install (emacs::default line 19)
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: apt_package[emacs] checking package status for emacs
[Wed, 09 May 2012 04:15:57 +0100] DEBUG: sh(apt-cache policy emacs)
emacs:
  Installed: (none)
  Candidate: 23.3+1-1ubuntu4
  Version table:
     23.3+1-1ubuntu4 0
        500 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
[Wed, 09 May 2012 04:15:58 +0100] DEBUG: apt_package[emacs] current version is nil
[Wed, 09 May 2012 04:15:58 +0100] DEBUG: apt_package[emacs] candidate version is 23.3+1-1ubuntu4
[Wed, 09 May 2012 04:15:58 +0100] DEBUG: Executing apt-get -q -y install emacs=23.3+1-1ubuntu4
[Wed, 09 May 2012 04:16:45 +0100] DEBUG: ---- Begin output of apt-get -q -y install emacs=23.3+1-1ubuntu4 ----
[Wed, 09 May 2012 04:16:45 +0100] DEBUG: STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  anthy anthy-common defoma dictionaries-common emacs23 emacs23-bin-common
  emacs23-common emacsen-common fontconfig gconf2-common hicolor-icon-theme
  iamerican ienglish-common ispell libanthy0 libasound2 libatk1.0-0
  libatk1.0-data libavahi-client3 libavahi-common-data libavahi-common3
  libcroco3 libcups2 libdatrie1 libfontenc1 libgconf2-4 libgd2-noxpm
  libgdk-pixbuf2.0-0 libgif4 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
  libice6 libjasper1 libjpeg62 libm17n-0 libotf0 libpango1.0-0 librsvg2-2
  libsm6 libthai-data libthai0 libtiff4 libxcomposite1 libxcursor1 libxdamage1
  libxfixes3 libxfont1 libxft2 libxi6 libxinerama1 libxpm4 libxrandr2 libxt6
  m17n-contrib m17n-db shared-mime-info wamerican x-ttcidfont-conf x11-common
  xfonts-encodings xfonts-utils
Suggested packages:
  defoma-doc psfontmgr libfont-freetype-perl jed-extra emacs23-el spell
  libasound2-plugins libasound2-python cups-common libgd-tools librsvg2-common
  gvfs libjasper-runtime m17n-docs ttf-japanese-gothic ttf-japanese-mincho
  ttf-thryomanes ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp
  ttf-arphic-gkai00mp ttf-arphic-bkai00mp librsvg2-bin gawk
The following NEW packages will be installed
  anthy anthy-common defoma dictionaries-common emacs emacs23
  emacs23-bin-common emacs23-common emacsen-common fontconfig gconf2-common
  hicolor-icon-theme iamerican ienglish-common ispell libanthy0 libasound2
  libatk1.0-0 libatk1.0-data libavahi-client3 libavahi-common-data
  libavahi-common3 libcroco3 libcups2 libdatrie1 libfontenc1 libgconf2-4
  libgd2-noxpm libgdk-pixbuf2.0-0 libgif4 libgtk2.0-0 libgtk2.0-bin
  libgtk2.0-common libice6 libjasper1 libjpeg62 libm17n-0 libotf0
  libpango1.0-0 librsvg2-2 libsm6 libthai-data libthai0 libtiff4
  libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxfont1 libxft2 libxi6
  libxinerama1 libxpm4 libxrandr2 libxt6 m17n-contrib m17n-db shared-mime-info
  wamerican x-ttcidfont-conf x11-common xfonts-encodings xfonts-utils
0 upgraded, 63 newly installed, 0 to remove and 2 not upgraded.
Need to get 40.1 MB of archives.
After this operation, 137 MB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libasound2 amd64 1.0.24.1-0ubuntu10 [417 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libatk1.0-data amd64 2.2.0-0ubuntu1 [12.6 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libatk1.0-0 amd64 2.2.0-0ubuntu1 [59.9 kB]
Get:4 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libavahi-common-data amd64 0.6.30-4ubuntu1 [22.4 kB]
Get:5 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libavahi-common3 amd64 0.6.30-4ubuntu1 [25.0 kB]
Get:6 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libavahi-client3 amd64 0.6.30-4ubuntu1 [43.2 kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates/main libcups2 amd64 1.5.0-8ubuntu6 [173 kB]
Get:8 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libdatrie1 amd64 0.2.4-3 [15.9 kB]
Get:9 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libjpeg62 amd64 6b1-1ubuntu2 [88.3 kB]
Get:10 http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates/main libjasper1 amd64 1.900.1-7ubuntu2.11.10.1 [155 kB]
Get:11 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libtiff4 amd64 3.9.5-1ubuntu1 [144 kB]
Get:12 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libgdk-pixbuf2.0-0 amd64 2.24.0-1ubuntu1 [198 kB]
Get:13 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libgtk2.0-common amd64 2.24.6-0ubuntu5 [114 kB]
Get:14 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libthai-data amd64 0.1.15-2 [177 kB]
Get:15 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libthai0 amd64 0.1.15-2 [19.3 kB]
Get:16 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxft2 amd64 2.2.0-3ubuntu1 [42.3 kB]
Get:17 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main fontconfig amd64 2.8.0-3ubuntu2 [157 kB]
Get:18 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libpango1.0-0 amd64 1.29.3+git20110916-0ubuntu1 [365 kB]
Get:19 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxcomposite1 amd64 1:0.4.3-2 [7,806 B]
Get:20 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxfixes3 amd64 1:5.0-4 [12.9 kB]
Get:21 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxcursor1 amd64 1:1.1.12-1 [22.6 kB]
Get:22 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxdamage1 amd64 1:1.1.3-2 [7,572 B]
Get:23 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxi6 amd64 2:1.4.3-3ubuntu1 [30.6 kB]
Get:24 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxinerama1 amd64 2:1.1.1-3 [8,044 B]
Get:25 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxrandr2 amd64 2:1.3.2-2 [17.9 kB]
Get:26 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main shared-mime-info amd64 0.90-1ubuntu4 [459 kB]
Get:27 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libgtk2.0-0 amd64 2.24.6-0ubuntu5 [2,250 kB]
Get:28 http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates/main x11-common amd64 1:7.6+7ubuntu7.1 [56.8 kB]
Get:29 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libice6 amd64 2:1.0.7-2 [46.2 kB]
Get:30 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libcroco3 amd64 0.6.2-1 [101 kB]
Get:31 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main librsvg2-2 amd64 2.34.1-2 [105 kB]
Get:32 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libsm6 amd64 2:1.2.0-2 [18.1 kB]
Get:33 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxt6 amd64 1:1.1.1-2 [185 kB]
Get:34 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main anthy-common all 9100h-9ubuntu1 [3,358 kB]
Get:35 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libanthy0 amd64 9100h-9ubuntu1 [171 kB]
Get:36 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main anthy amd64 9100h-9ubuntu1 [148 kB]
Get:37 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main defoma all 0.11.12ubuntu1 [91.2 kB]
Get:38 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main dictionaries-common all 1.11.5ubuntu1 [247 kB]
Get:39 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main emacsen-common all 1.4.19ubuntu2 [17.7 kB]
Get:40 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main emacs23-common all 23.3+1-1ubuntu4 [22.5 MB]
Get:41 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main emacs23-bin-common amd64 23.3+1-1ubuntu4 [176 kB]
Get:42 http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates/main gconf2-common all 3.2.3-0ubuntu0.1 [20.4 kB]
Get:43 http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates/main libgconf2-4 amd64 3.2.3-0ubuntu0.1 [171 kB]
Get:44 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libgif4 amd64 4.1.6-9 [41.4 kB]
Get:45 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libgd2-noxpm amd64 2.0.36~rc1~dfsg-5.1ubuntu1 [198 kB]
Get:46 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libotf0 amd64 0.9.12-1 [49.5 kB]
Get:47 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main m17n-db all 1.6.2-2 [1,684 kB]
Get:48 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main m17n-contrib all 1.1.12-2 [504 kB]
Get:49 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libm17n-0 amd64 1.6.2-3 [300 kB]
Get:50 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxpm4 amd64 1:3.5.9-1ubuntu1 [37.8 kB]
Get:51 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main emacs23 amd64 23.3+1-1ubuntu4 [3,334 kB]
Get:52 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main emacs all 23.3+1-1ubuntu4 [5,736 B]
Get:53 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main hicolor-icon-theme amd64 0.12-1ubuntu1 [10.0 kB]
Get:54 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main ispell amd64 3.3.02-5 [162 kB]
Get:55 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main ienglish-common all 3.3.02-5 [11.2 kB]
Get:56 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main iamerican all 3.3.02-5 [187 kB]
Get:57 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libfontenc1 amd64 1:1.1.0-1 [15.4 kB]
Get:58 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libgtk2.0-bin amd64 2.24.6-0ubuntu5 [10.3 kB]
Get:59 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libxfont1 amd64 1:1.4.4-1 [133 kB]
Get:60 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main wamerican all 6-3 [269 kB]
Get:61 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main xfonts-encodings all 1:1.0.4-1 [583 kB]
Get:62 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main xfonts-utils amd64 1:7.6+1 [96.4 kB]
Get:63 http://gb.archive.ubuntu.com/ubuntu/ oneiric/main x-ttcidfont-conf all 32+nmu2 [20.2 kB]
Preconfiguring packages ...
Fetched 40.1 MB in 22s (1,775 kB/s)
Selecting previously deselected package libasound2.
(Reading database ... 56992 files and directories currently installed.)
Unpacking libasound2 (from .../libasound2_1.0.24.1-0ubuntu10_amd64.deb) ...
Selecting previously deselected package libatk1.0-data.
Unpacking libatk1.0-data (from .../libatk1.0-data_2.2.0-0ubuntu1_amd64.deb) ...
Selecting previously deselected package libatk1.0-0.
Unpacking libatk1.0-0 (from .../libatk1.0-0_2.2.0-0ubuntu1_amd64.deb) ...
Selecting previously deselected package libavahi-common-data.
Unpacking libavahi-common-data (from .../libavahi-common-data_0.6.30-4ubuntu1_amd64.deb) ...
Selecting previously deselected package libavahi-common3.
Unpacking libavahi-common3 (from .../libavahi-common3_0.6.30-4ubuntu1_amd64.deb) ...
Selecting previously deselected package libavahi-client3.
Unpacking libavahi-client3 (from .../libavahi-client3_0.6.30-4ubuntu1_amd64.deb) ...
Selecting previously deselected package libcups2.
Unpacking libcups2 (from .../libcups2_1.5.0-8ubuntu6_amd64.deb) ...
Selecting previously deselected package libdatrie1.
Unpacking libdatrie1 (from .../libdatrie1_0.2.4-3_amd64.deb) ...
Selecting previously deselected package libjpeg62.
Unpacking libjpeg62 (from .../libjpeg62_6b1-1ubuntu2_amd64.deb) ...
Selecting previously deselected package libjasper1.
Unpacking libjasper1 (from .../libjasper1_1.900.1-7ubuntu2.11.10.1_amd64.deb) ...
Selecting previously deselected package libtiff4.
Unpacking libtiff4 (from .../libtiff4_3.9.5-1ubuntu1_amd64.deb) ...
Selecting previously deselected package libgdk-pixbuf2.0-0.
Unpacking libgdk-pixbuf2.0-0 (from .../libgdk-pixbuf2.0-0_2.24.0-1ubuntu1_amd64.deb) ...
Selecting previously deselected package libgtk2.0-common.
Unpacking libgtk2.0-common (from .../libgtk2.0-common_2.24.6-0ubuntu5_amd64.deb) ...
Selecting previously deselected package libthai-data.
Unpacking libthai-data (from .../libthai-data_0.1.15-2_amd64.deb) ...
Selecting previously deselected package libthai0.
Unpacking libthai0 (from .../libthai0_0.1.15-2_amd64.deb) ...
Selecting previously deselected package libxft2.
Unpacking libxft2 (from .../libxft2_2.2.0-3ubuntu1_amd64.deb) ...
Selecting previously deselected package fontconfig.
Unpacking fontconfig (from .../fontconfig_2.8.0-3ubuntu2_amd64.deb) ...
Selecting previously deselected package libpango1.0-0.
Unpacking libpango1.0-0 (from .../libpango1.0-0_1.29.3+git20110916-0ubuntu1_amd64.deb) ...
Selecting previously deselected package libxcomposite1.
Unpacking libxcomposite1 (from .../libxcomposite1_1%3a0.4.3-2_amd64.deb) ...
Selecting previously deselected package libxfixes3.
Unpacking libxfixes3 (from .../libxfixes3_1%3a5.0-4_amd64.deb) ...
Selecting previously deselected package libxcursor1.
Unpacking libxcursor1 (from .../libxcursor1_1%3a1.1.12-1_amd64.deb) ...
Selecting previously deselected package libxdamage1.
Unpacking libxdamage1 (from .../libxdamage1_1%3a1.1.3-2_amd64.deb) ...
Selecting previously deselected package libxi6.
Unpacking libxi6 (from .../libxi6_2%3a1.4.3-3ubuntu1_amd64.deb) ...
Selecting previously deselected package libxinerama1.
Unpacking libxinerama1 (from .../libxinerama1_2%3a1.1.1-3_amd64.deb) ...
Selecting previously deselected package libxrandr2.
Unpacking libxrandr2 (from .../libxrandr2_2%3a1.3.2-2_amd64.deb) ...
Selecting previously deselected package shared-mime-info.
Unpacking shared-mime-info (from .../shared-mime-info_0.90-1ubuntu4_amd64.deb) ...
Selecting previously deselected package libgtk2.0-0.
Unpacking libgtk2.0-0 (from .../libgtk2.0-0_2.24.6-0ubuntu5_amd64.deb) ...
Selecting previously deselected package x11-common.
Unpacking x11-common (from .../x11-common_1%3a7.6+7ubuntu7.1_amd64.deb) ...
Selecting previously deselected package libice6.
Unpacking libice6 (from .../libice6_2%3a1.0.7-2_amd64.deb) ...
Selecting previously deselected package libcroco3.
Unpacking libcroco3 (from .../libcroco3_0.6.2-1_amd64.deb) ...
Selecting previously deselected package librsvg2-2.
Unpacking librsvg2-2 (from .../librsvg2-2_2.34.1-2_amd64.deb) ...
Selecting previously deselected package libsm6.
Unpacking libsm6 (from .../libsm6_2%3a1.2.0-2_amd64.deb) ...
Selecting previously deselected package libxt6.
Unpacking libxt6 (from .../libxt6_1%3a1.1.1-2_amd64.deb) ...
Selecting previously deselected package anthy-common.
Unpacking anthy-common (from .../anthy-common_9100h-9ubuntu1_all.deb) ...
Selecting previously deselected package libanthy0.
Unpacking libanthy0 (from .../libanthy0_9100h-9ubuntu1_amd64.deb) ...
Selecting previously deselected package anthy.
Unpacking anthy (from .../anthy_9100h-9ubuntu1_amd64.deb) ...
Selecting previously deselected package defoma.
Unpacking defoma (from .../defoma_0.11.12ubuntu1_all.deb) ...
Selecting previously deselected package dictionaries-common.
Unpacking dictionaries-common (from .../dictionaries-common_1.11.5ubuntu1_all.deb) ...
Adding 'diversion of /usr/share/dict/words to /usr/share/dict/words.pre-dictionaries-common by dictionaries-common'
Selecting previously deselected package emacsen-common.
Unpacking emacsen-common (from .../emacsen-common_1.4.19ubuntu2_all.deb) ...
Selecting previously deselected package emacs23-common.
Unpacking emacs23-common (from .../emacs23-common_23.3+1-1ubuntu4_all.deb) ...
Selecting previously deselected package emacs23-bin-common.
Unpacking emacs23-bin-common (from .../emacs23-bin-common_23.3+1-1ubuntu4_amd64.deb) ...
Selecting previously deselected package gconf2-common.
Unpacking gconf2-common (from .../gconf2-common_3.2.3-0ubuntu0.1_all.deb) ...
Selecting previously deselected package libgconf2-4.
Unpacking libgconf2-4 (from .../libgconf2-4_3.2.3-0ubuntu0.1_amd64.deb) ...
Selecting previously deselected package libgif4.
Unpacking libgif4 (from .../libgif4_4.1.6-9_amd64.deb) ...
Selecting previously deselected package libgd2-noxpm.
Unpacking libgd2-noxpm (from .../libgd2-noxpm_2.0.36~rc1~dfsg-5.1ubuntu1_amd64.deb) ...
Selecting previously deselected package libotf0.
Unpacking libotf0 (from .../libotf0_0.9.12-1_amd64.deb) ...
Selecting previously deselected package m17n-db.
Unpacking m17n-db (from .../m17n-db_1.6.2-2_all.deb) ...
Selecting previously deselected package m17n-contrib.
Unpacking m17n-contrib (from .../m17n-contrib_1.1.12-2_all.deb) ...
Selecting previously deselected package libm17n-0.
Unpacking libm17n-0 (from .../libm17n-0_1.6.2-3_amd64.deb) ...
Selecting previously deselected package libxpm4.
Unpacking libxpm4 (from .../libxpm4_1%3a3.5.9-1ubuntu1_amd64.deb) ...
Selecting previously deselected package emacs23.
Unpacking emacs23 (from .../emacs23_23.3+1-1ubuntu4_amd64.deb) ...
Selecting previously deselected package emacs.
Unpacking emacs (from .../emacs_23.3+1-1ubuntu4_all.deb) ...
Selecting previously deselected package hicolor-icon-theme.
Unpacking hicolor-icon-theme (from .../hicolor-icon-theme_0.12-1ubuntu1_amd64.deb) ...
Selecting previously deselected package ispell.
Unpacking ispell (from .../ispell_3.3.02-5_amd64.deb) ...
Selecting previously deselected package ienglish-common.
Unpacking ienglish-common (from .../ienglish-common_3.3.02-5_all.deb) ...
Selecting previously deselected package iamerican.
Unpacking iamerican (from .../iamerican_3.3.02-5_all.deb) ...
Selecting previously deselected package libfontenc1.
Unpacking libfontenc1 (from .../libfontenc1_1%3a1.1.0-1_amd64.deb) ...
Selecting previously deselected package libgtk2.0-bin.
Unpacking libgtk2.0-bin (from .../libgtk2.0-bin_2.24.6-0ubuntu5_amd64.deb) ...
Selecting previously deselected package libxfont1.
Unpacking libxfont1 (from .../libxfont1_1%3a1.4.4-1_amd64.deb) ...
Selecting previously deselected package wamerican.
Unpacking wamerican (from .../archives/wamerican_6-3_all.deb) ...
Selecting previously deselected package xfonts-encodings.
Unpacking xfonts-encodings (from .../xfonts-encodings_1%3a1.0.4-1_all.deb) ...
Selecting previously deselected package xfonts-utils.
Unpacking xfonts-utils (from .../xfonts-utils_1%3a7.6+1_amd64.deb) ...
Selecting previously deselected package x-ttcidfont-conf.
Unpacking x-ttcidfont-conf (from .../x-ttcidfont-conf_32+nmu2_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for install-info ...
Setting up libasound2 (1.0.24.1-0ubuntu10) ...
Setting up libatk1.0-data (2.2.0-0ubuntu1) ...
Setting up libatk1.0-0 (2.2.0-0ubuntu1) ...
Setting up libavahi-common-data (0.6.30-4ubuntu1) ...
Setting up libavahi-common3 (0.6.30-4ubuntu1) ...
Setting up libavahi-client3 (0.6.30-4ubuntu1) ...
Setting up libcups2 (1.5.0-8ubuntu6) ...
Setting up libdatrie1 (0.2.4-3) ...
Setting up libjpeg62 (6b1-1ubuntu2) ...
Setting up libjasper1 (1.900.1-7ubuntu2.11.10.1) ...
Setting up libtiff4 (3.9.5-1ubuntu1) ...
Setting up libgdk-pixbuf2.0-0 (2.24.0-1ubuntu1) ...
Setting up libgtk2.0-common (2.24.6-0ubuntu5) ...
Setting up libthai-data (0.1.15-2) ...
Setting up libthai0 (0.1.15-2) ...
Setting up libxft2 (2.2.0-3ubuntu1) ...
Setting up fontconfig (2.8.0-3ubuntu2) ...
Cleaning up old fontconfig caches... done.
Regenerating fonts cache... done.
Setting up libpango1.0-0 (1.29.3+git20110916-0ubuntu1) ...
Setting up libxcomposite1 (1:0.4.3-2) ...
Setting up libxfixes3 (1:5.0-4) ...
Setting up libxcursor1 (1:1.1.12-1) ...
Setting up libxdamage1 (1:1.1.3-2) ...
Setting up libxi6 (2:1.4.3-3ubuntu1) ...
Setting up libxinerama1 (2:1.1.1-3) ...
Setting up libxrandr2 (2:1.3.2-2) ...
Setting up shared-mime-info (0.90-1ubuntu4) ...
Setting up libgtk2.0-0 (2.24.6-0ubuntu5) ...
Setting up x11-common (1:7.6+7ubuntu7.1) ...
Setting up libice6 (2:1.0.7-2) ...
Setting up libcroco3 (0.6.2-1) ...
Setting up librsvg2-2 (2.34.1-2) ...
Setting up libsm6 (2:1.2.0-2) ...
Setting up libxt6 (1:1.1.1-2) ...
Setting up anthy-common (9100h-9ubuntu1) ...
Setting up libanthy0 (9100h-9ubuntu1) ...
Setting up anthy (9100h-9ubuntu1) ...
Setting up defoma (0.11.12ubuntu1) ...
Setting up dictionaries-common (1.11.5ubuntu1) ...
Setting up emacsen-common (1.4.19ubuntu2) ...
emacsen-common: Handling install of emacsen flavor emacs
Setting up emacs23-common (23.3+1-1ubuntu4) ...
Setting up emacs23-bin-common (23.3+1-1ubuntu4) ...
update-alternatives: using /usr/bin/b2m.emacs23 to provide /usr/bin/b2m (b2m) in auto mode.
update-alternatives: using /usr/bin/ctags.emacs23 to provide /usr/bin/ctags (ctags) in auto mode.
update-alternatives: using /usr/bin/ebrowse.emacs23 to provide /usr/bin/ebrowse (ebrowse) in auto mode.
update-alternatives: using /usr/bin/emacsclient.emacs23 to provide /usr/bin/emacsclient (emacsclient) in auto mode.
update-alternatives: using /usr/bin/etags.emacs23 to provide /usr/bin/etags (etags) in auto mode.
update-alternatives: using /usr/bin/grep-changelog.emacs23 to provide /usr/bin/grep-changelog (grep-changelog) in auto mode.
update-alternatives: using /usr/bin/rcs-checkin.emacs23 to provide /usr/bin/rcs-checkin (rcs-checkin) in auto mode.
Setting up gconf2-common (3.2.3-0ubuntu0.1) ...
Setting up libgconf2-4 (3.2.3-0ubuntu0.1) ...
Setting up libgif4 (4.1.6-9) ...
Setting up libgd2-noxpm (2.0.36~rc1~dfsg-5.1ubuntu1) ...
Setting up libotf0 (0.9.12-1) ...
Setting up m17n-db (1.6.2-2) ...
Setting up m17n-contrib (1.1.12-2) ...
Setting up libm17n-0 (1.6.2-3) ...
Setting up libxpm4 (1:3.5.9-1ubuntu1) ...
Setting up emacs23 (23.3+1-1ubuntu4) ...
update-alternatives: using /usr/bin/emacs23-x to provide /usr/bin/emacs (emacs) in auto mode.
emacs-install emacs23
install/dictionaries-common: Byte-compiling for emacsen flavour emacs23
emacsen-common: Handling install of emacsen flavor emacs23
emacsen-common: byte-compiling for emacs23
Setting up emacs (23.3+1-1ubuntu4) ...
Setting up hicolor-icon-theme (0.12-1ubuntu1) ...
Setting up libfontenc1 (1:1.1.0-1) ...
Setting up libgtk2.0-bin (2.24.6-0ubuntu5) ...
Setting up libxfont1 (1:1.4.4-1) ...
Setting up wamerican (6-3) ...
Setting up xfonts-encodings (1:1.0.4-1) ...
Setting up xfonts-utils (1:7.6+1) ...
Setting up x-ttcidfont-conf (32+nmu2) ...
Processing triggers for dictionaries-common ...
Setting up ispell (3.3.02-5) ...
Processing triggers for dictionaries-common ...
Setting up ienglish-common (3.3.02-5) ...
Setting up iamerican (3.3.02-5) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for dictionaries-common ...
Extract templates from packages: 100%UG: STDERR: 
Updating font configuration of fontconfig...
Cleaning up category cid..
Cleaning up category truetype..
Cleaning up category type1..
Updating category type1..
Updating category truetype..
Updating category cid..
Cannot load module /usr/lib/gtk-2.0/2.10.0/immodules/*.so: /usr/lib/gtk-2.0/2.10.0/immodules/*.so: cannot open shared object file: No such file or directory
/usr/lib/gtk-2.0/2.10.0/immodules/*.so does not export GTK+ IM module API: /usr/lib/gtk-2.0/2.10.0/immodules/*.so: cannot open shared object file: No such file or directory
Updating anthy.dic...file name prefix=[./] you can change this by -p option.
  copying .///mkworddic/anthy.wdic (word_dic)
  copying .///depgraph/anthy.dep (dep_dic)
  copying .///calctrans/anthy.trans_info (trans_info)
  copying .///calctrans/anthy.cand_info (cand_info)
  copying .///calctrans/anthy.weak_words (weak_words)
  copying .///calctrans/anthy.corpus_bucket (corpus_bucket)
  copying .///calctrans/anthy.corpus_array (corpus_array)
/usr/bin/mkfiledic done.
done.
ispell-autobuildhash: Processing 'american' dict.

Creating config file /etc/gconf/2/path with new version
Wrote /usr/share/emacs23/site-lisp/dictionaries-common/debian-ispell.elc
Wrote /usr/share/emacs23/site-lisp/dictionaries-common/ispell.elc
Wrote /usr/share/emacs23/site-lisp/dictionaries-common/flyspell.elc
Wrote /etc/emacs23/site-start.d/00debian-vars.elc
Wrote /usr/share/emacs23/site-lisp/debian-startup.elc
Updating font configuration of x-ttcidfont-conf...
Cleaning up category cmap..
Cleaning up category cid..
Cleaning up category truetype..
Updating category truetype..
Updating category cid..
Updating category cmap..
[Wed, 09 May 2012 04:16:45 +0100] DEBUG: ---- End output of apt-get -q -y install emacs=23.3+1-1ubuntu4 ----
[Wed, 09 May 2012 04:16:45 +0100] DEBUG: Ran apt-get -q -y install emacs=23.3+1-1ubuntu4 returned 0
[Wed, 09 May 2012 04:16:45 +0100] INFO: apt_package[emacs] installed version 23.3+1-1ubuntu4
[Wed, 09 May 2012 04:16:45 +0100] INFO: Chef Run complete in 91.96998 seconds
[Wed, 09 May 2012 04:16:45 +0100] DEBUG: Cleaning the checksum cache
[Wed, 09 May 2012 04:16:45 +0100] INFO: Running report handlers
[Wed, 09 May 2012 04:16:45 +0100] INFO: Report handlers complete
[Wed, 09 May 2012 04:16:45 +0100] DEBUG: Exiting

細かいログの流れは後で追うとして、入れたかったgit,rake,emacsが入っているか確認。

$ git --version
git version 1.7.5.4
$ rake --version
Invalid gemspec in [/var/lib/gems/1.8/specifications/json-1.6.1.gemspec]: invalid date format in specification: "2011-09-18 00:00:00.000000000Z"
rake, version 0.9.2.2
$ emacs --version
GNU Emacs 23.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

おお、入ってる。だけど、rakeの方でInvalid gemspecと言われている。これはgemspecの問題・・?
そして、意味のなかったsolo.rbとchef.jsonも一応うまく入った模様。権限がchefで指定した744になっている。

$ ls -la /vagrant_data/
total 12
drwxr-xr-x  1 vagrant vagrant  170 2012-05-09 04:10 .
drwxr-xr-x 25 root    root    4096 2012-05-09 04:13 ..
  • rwxr--r-- 1 vagrant vagrant 94 2012-05-09 04:10 chef.json
drwxr-xr-x 1 vagrant vagrant 442 2012-05-09 04:10 chef-repo
  • rwxr--r-- 1 vagrant vagrant 100 2012-05-09 04:10 solo.rb

ということで、chefと戯れた一週間だった。これは最初の一台を作る時に使えば、後がぐっと楽になる。
レシピファイルをバージョン管理しておけば、各ミドルウェアのupgrade,downgradeもすごい簡単。そして設定ファイルとかもtemplatesに押し込めるのがいい。http.confとかmy.confとかのあたりも、ここで管理してしまえば各サーバで設定が違うんだよーといったことはなくなる、はず。
puppetでも同じようなことができるけど、各ディレクトリの名前が直感的でなによりrubyでかけるのが素敵。

自分が好きな環境、例えば”Rails×Nginx×Unicorn”の環境一式とかを作る際に一度cookbookを作ってしまえば、
その後は仮想だろうと物理だろうと同じ構成が手軽に作成できる。開発環境、ステージング環境、本番環境でディレクトリ構成が微妙に違う・・・?といった問題は、同じcookbookを使えば回避できる。

また、Railsのバージョンをあげたいけど共有の環境でやる前のステップとして、一度ローカルで同じcookbookを使い、Railsのバージョンだけあげておき、仮想マシンを作成してみるといった使い方もできる。バージョンをあげるのは、chefの.rbファイルを1ついじるだけで検証できる。

Chefのメリット

各サーバの構成管理はChefにおまかせし、開発者は設定ファイルを管理すればよい(理論的には)

名前がわかりやすい

参考にさせていただいたサイト
Chef でサーバ管理を楽チンにしよう! (第 1 回)
Chef