serverspec 動作確認を、と思いつつスルーしてたので

確認着手の方向。
とりあえず、手元の環境で virtualbox とか vagrant が導入されてる事を確認。おそらくこれって、入門 Chef-solo なソレを云々した名残ではないかと。
で、.box なファイルを find してみたら vagrant.d みたいなディレクトリを発見。後天性記憶不全って本当に怖いな。

帰宅後作業着手

ええと、vagrant up して云々、なんですが $HOME 配下に .vagrant.d というディレクトリがあることを確認してます。こっちに諸々なナニが入っている模様。
このあたりは別途確認ってことにしてとりあえず vagrant up して vagrant ssh してみました。netstat なナニが以下なカンジ。

tcp        0      0 127.0.0.1:33562         127.0.0.1:2222          ESTABLISHED 13664/ssh       

ifconfig な出力が以下。

eth0      Link encap:Ethernet  HWaddr 08:00:27:12:96:98  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe12:9698/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:460 errors:0 dropped:0 overruns:0 frame:0
          TX packets:345 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:48287 (48.2 KB)  TX bytes:42145 (42.1 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:60:04:e1  
          inet addr:192.168.33.10  Bcast:192.168.33.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe60:4e1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1250 (1.2 KB)  TX bytes:1152 (1.1 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1296 (1.2 KB)  TX bytes:1296 (1.2 KB)

eth1 側は設定ファイルに記述があります。

$ grep '192.168' Vagrantfile
  config.vm.network :private_network, ip: "192.168.33.10"

あるいはこの i/f 経由でログインしてみます。

$ ssh vagrant@192.168.33.10
vagrant@192.168.33.10's password: 
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

 * Documentation:  https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Tue Apr 30 11:53:54 2013 from 192.168.33.1
vagrant@precise32:~$ 

パスワードは vagrant でした。ここまでアレできてると Chef-Solo と serverspec は色々確認できるのかな。

sahara を云々してみる

とりあえず入れてみる。

$ gem install sahara -r --no-ri --no-rdoc
Fetching: vagrant-1.0.7.gem (100%)
Fetching: Platform-0.4.0.gem (100%)
Fetching: open4-1.3.0.gem (100%)
Fetching: popen4-0.1.2.gem (100%)
Fetching: sahara-0.0.13.gem (100%)
Successfully installed vagrant-1.0.7
Successfully installed Platform-0.4.0
Successfully installed open4-1.3.0
Successfully installed popen4-0.1.2
Successfully installed sahara-0.0.13
5 gems installed

む、vagrant gem とか使えんな。vagrant sandbox も同様。う、vagrant plugin らしい。

$ vagrant plugin install sahara
Installing the 'sahara' plugin. This can take a few minutes...
Installed the plugin 'sahara (0.0.13)'!

を、できたのかな。sandbox on してみます。

$ vagrant sandbox on
Vagrant failed to initialize at a very early stage:

It appears that you've ran a newer version of Vagrant on this
computer. Unfortunately, newer versions of Vagrant change internal
directory layouts that cause older versions to break. This version
of Vagrant cannot properly run.

If you'd like to start from a clean state, please remove the
Vagrant state directory: /home/rms/.vagrant.d

Warning that this will remove all your boxes and potentially corrupt
existing Vagrant environments that were running based on the future
version.

え、消すのか。とりあえず言われるがままに削除してみます。なんかヤバい予感がしてますが構わず削除。

$ rm -rf ~/.vagrant.d

で、以下を実行。

$ vagrant box add ubuntu-12.04-x64 http://files.vagrantup.com/precise64.box

これは当分かかるな。

box add 終了

ええと、.rbenv と /usr/bin の vagrant がケンカしてます。

The VM failed to remain in the "running" state while attempting to boot.
This is normally caused by a misconfiguration or host system incompatibilities.
Please open the VirtualBox GUI and attempt to boot the virtual machine
manually to get a more informative error message.

うーん。以下なメセジの出力も確認。

[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.

Guest Additions Version: 4.2.0
VirtualBox Version: 4.1

うーん、困った。とりあえずでびあんパケジなナニを削除した方が良いのかどうか。

$ vagrant -v
Vagrant version 1.1.2
$ /usr/bin/vagrant -v
Vagrant version 1.1.2

なんとなく sahara 導入した瞬間に vagrant が入って云々、に見えますが 1.0.7 ですか。これって一旦削除するんでしたっけ。

$ gem uninstall vagrant

で削除できた模様。でも挙動は変わらず。どうもわしは vagrant と相性悪いな。ごめんなさい。続きは明日以降で。