LoginSignup
3
3

More than 5 years have passed since last update.

Vagrant + Chef構築メモ

Last updated at Posted at 2018-09-26

Cehfとは

Vagrantを利用する際を想定する。
Chefを使用することで複数のVagrantファイルを作成した時
パッケージのインストールをレシピで別で管理することで
Vagrantの環境で自分の作成したレシピを自由に選ぶことができるようになる。

Chefの環境構築

rubyはrbenvでインストールしておく
Chefは公式からダウンロードもできるが今回はgemでインストールする。

(ホストOSに)Chef関連のインストール

$ gem i chef
$ gem i chef-solo --pre
$ gem i berkshelf

(ホストOSに)Vagrantのプラグインをインストール

$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-berkshelf

knife-soloを使用して環境構築

cd ~/your/vagrant/path
Vagrantfileがあるディレクトより一つ親のディレクトリに環境を作成
$ knife solo init .

~/your/vagrant/path
$ ls -1
Berksfile
cookbooks/
data_bags/
environments/
nodes/
roles/
site-cookbooks/
vagrant-ubuntu/
vagrant-xxx/
vagrant-yyy/
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3