Skip to content

Instantly share code, notes, and snippets.

@ikeikeikeike
Created March 14, 2012 12:40
Show Gist options
  • Select an option

  • Save ikeikeikeike/2036210 to your computer and use it in GitHub Desktop.

Select an option

Save ikeikeikeike/2036210 to your computer and use it in GitHub Desktop.
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# ボックスの指定
config.vm.box = "ubuntu11.10-server-amd64"
# ボックスがなければURLからダウンロード
config.vm.box_url = "http://timhuegdon.com/vagrant-boxes/ubuntu-11.10.box"
# gui
config.vm.boot_mode = :gui
# network指定
config.vm.network :hostonly, "192.168.33.10"
# config.vm.network :bridged
# Chef設定
config.vm.provision :chef_solo do |chef|
# cookbooks path
chef.cookbooks_path = "cookbooks"
# レシピ追加
chef.add_recipe("apt")
chef.add_recipe("nginx")
chef.add_recipe("python")
chef.add_recipe("rabbitmq")
chef.add_recipe("git")
# attributesの上書き
chef.json.merge!(
{
:nginx => {
:user => "root"
}
},
:rabbitmq => {
:default_user => "rabbit",
:default_pass => "rabbit"
}
)
# 下記の形式で指定する方法もあり
chef.run_list = [
"recipe[apt]",
"recipe[nginx]",
"recipe[python]",
"recipe[rabbitmq]",
"recipe[git]",
]
chef.json = {
:python => {
:version => "2.7.2",
}
}
end
# 仮想マシン設定
config.vm.customize do |vm|
# memoty 2G
vm.memory_size = 2048
vm.name = "ubuntu11.10-server-amd64"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment