Created
February 25, 2011 06:11
-
-
Save vishvananda/843431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant::Config.run do |global_config| | |
aptdir = "#{ENV['HOME']}/aptcache/" | |
checkout = "#{ENV['HOME']}/openstack-cookbooks" | |
ip_prefix = (ENV['IP_PREFIX'] or "192.168.76.") | |
mac_prefix = (ENV['MAC_PREFIX'] or "080027076") | |
global_config.vm.define :chef do |config| | |
suffix = "100" | |
ip = "#{ip_prefix}#{suffix}" | |
config.vm.box = "base" | |
config.vm.box_url = "http://images.anso.com/vagrant/maverick64.box" | |
config.vm.customize do |vm| | |
vm.memory_size = 1024 | |
end | |
config.vm.network(ip, :mac => "#{mac_prefix}#{suffix}") | |
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!({ | |
:nova => { | |
:my_ip => ip, | |
}, | |
:chef => { | |
:server_url => "http://localhost:4000", | |
:webui_enabled => true, | |
}, | |
:cookbooks => { | |
:branch => "devpackages" | |
}, | |
}) | |
end | |
end | |
global_config.vm.define :head do |config| | |
suffix = "101" | |
ip = "#{ip_prefix}#{suffix}" | |
config.vm.box = "base" | |
config.vm.box_url = "http://images.ansolabs.com/vagrant/maverick64.box" | |
config.vm.customize do |vm| | |
vm.memory_size = 1024 | |
end | |
config.vm.network(ip, :mac => "#{mac_prefix}#{suffix}") | |
config.vm.share_folder("v-apt", "/var/cache/apt", aptdir) | |
config.vm.provision :chef_server do |chef| | |
chef.chef_server_url = "http://#{ip_prefix}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::dashboard]", | |
"recipe[nova::creds]", # put creds for admin user | |
] | |
chef.json.merge!({ | |
:nova => { | |
:my_ip => ip, | |
:fixed_range => (ENV['FIXED'] or "10.0.76.0/24"), | |
:floating_range => (ENV['FLOATING'] or "#{ip_prefix}128/28"), | |
:public_interface => "br100", | |
:images => [ | |
"http://#{ip_prefix}100/tty.tgz" | |
], | |
:creds => { | |
:user => "vagrant", | |
:group => "vagrant", | |
:dir => "/vagrant", | |
} | |
}, | |
:apt => { | |
:distro => "maverick", | |
:proxy_url => "http://#{ip_prefix}100:3142", | |
} | |
}) | |
end | |
end | |
global_config.vm.define :node do |config| | |
suffix = "102" | |
ip = "#{ip_prefix}#{suffix}" | |
config.vm.box = "base" | |
config.vm.box_url = "http://images.ansolabs.com/vagrant/maverick64.box" | |
config.vm.customize do |vm| | |
vm.memory_size = 1024 | |
end | |
config.vm.network(ip, :mac => "#{mac_prefix}#{suffix}") | |
config.vm.share_folder("v-apt", "/var/cache/apt", aptdir) | |
config.vm.provision :chef_server do |chef| | |
chef.chef_server_url = "http://#{ip_prefix}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://#{ip_prefix}100:3142", | |
} | |
}) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment