Skip to content

Instantly share code, notes, and snippets.

@vishvananda
Created January 27, 2011 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishvananda/797885 to your computer and use it in GitHub Desktop.
Save vishvananda/797885 to your computer and use it in GitHub Desktop.
Vagrant::Config.run do |global_config|
aptdir = "#{ENV['HOME']}/aptcache/"
checkout = "#{ENV['HOME']}/openstack-cookbooks"
global_config.vm.define :chef do |config|
ip = "192.168.76.100"
# path where code is checked out
config.vm.box = "base"
config.vm.box_url = "http://images.anso.com/vagrant/maverick64.box"
config.vm.network ip
config.vm.share_folder("v-apt", "/var/cache/apt", aptdir)
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "#{checkout}/cookbooks"
chef.roles_path = "#{checkout}/roles"
chef.log_level = :debug
chef.run_list = [
#"recipe[apt::cacher]",
"recipe[anso::ohai]",
"recipe[chef::bootstrap_server]",
"recipe[anso::cookbooks]",
"recipe[nginx]",
"recipe[anso::tty]",
#"recipe[anso::settings]", # vim / screen / git settings for testing
]
chef.json.merge!({
:chef => {
:server_url => "http://localhost:4000",
:webui_enabled => true,
},
:cookbooks => {
:branch => "devpackages"
},
})
end
end
global_config.vm.define :head do |config|
ip = "192.168.76.111"
config.vm.box = "base"
config.vm.box_url = "http://images.ansolabs.com/vagrant/maverick64.box"
config.vm.network ip
config.vm.share_folder("v-apt", "/var/cache/apt", aptdir)
config.vm.provision :chef_server do |chef|
chef.chef_server_url = "http://192.168.76.100:4000"
chef.validation_key_path = "vagrant.pem"
chef.validation_client_name = "vagrant"
chef.node_name = "nova-head-vagrant"
chef.provisioning_path = "/etc/chef"
chef.log_level = :debug
chef.run_list = [
"recipe[nova::hostname]",
#"recipe[anso::apt_proxy]",
"recipe[anso::devpackages]",
"recipe[nova::mysql]",
"recipe[nova::rabbit]",
"recipe[nova::api]",
"recipe[nova::scheduler]",
"recipe[nova::network]",
"recipe[nova::objectstore]",
"recipe[nova::setup]",
"recipe[nova::creds]", # put creds for admin user
]
chef.json.merge!({
:nova => {
:my_ip => ip,
:images => [
"http://192.168.76.100/tty.tgz"
],
:creds => {
:user => "vagrant",
:group => "vagrant",
:dir => "/vagrant",
}
},
:apt => {
:distro => "maverick",
:proxy_url => "http://192.168.76.100:3142",
}
})
end
end
global_config.vm.define :node do |config|
ip = "192.168.76.112"
config.vm.box = "base"
config.vm.box_url = "http://images.ansolabs.com/vagrant/maverick64.box"
config.vm.network ip
config.vm.share_folder("v-apt", "/var/cache/apt", aptdir)
config.vm.provision :chef_server do |chef|
chef.chef_server_url = "http://192.168.76.100:4000"
# This needs to be set to the validator
chef.validation_key_path = "vagrant.pem"
chef.validation_client_name = "vagrant"
chef.node_name = "nova-node-vagrant"
chef.provisioning_path = "/etc/chef"
chef.log_level = :debug
chef.run_list = [
"recipe[nova::hostname]",
#"recipe[anso::apt_proxy]",
"recipe[anso::devpackages]",
"recipe[nova::filevg]",
"recipe[nova::volume]",
"recipe[nova::compute]",
#"recipe[anso::settings]", # vim / screen / git settings for testing
]
chef.json.merge!({
:nova => {
:my_ip => ip,
:libvirt_type => "qemu",
},
:apt => {
:distro => "maverick",
:proxy_url => "http://192.168.76.100:3142",
}
})
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment