Skip to content

Instantly share code, notes, and snippets.

@dhellmann
Forked from oubiwann/devstack.rb
Created March 2, 2012 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dhellmann/1961332 to your computer and use it in GitHub Desktop.
Save dhellmann/1961332 to your computer and use it in GitHub Desktop.
Vagrant script for devstack
# -*- mode: ruby -*-
Vagrant::Config.run do |config|
sshdir = "#{ENV['HOME']}/.ssh/"
cachedir = (ENV['CACHEDIR'] or "/Users/dhellmann/Documents/Devel/openstack-vm/cache")
checkout = (ENV['COOKBOOKS'] or "/Users/dhellmann/Documents/Devel/openstack-vm/openstack-cookbooks")
# Make /vagrant an NFS mount instead of using the default setting
#config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true)
ip_prefix = (ENV['IP_PREFIX'] or "10.0.5.")
mac_prefix = (ENV['MAC_PREFIX'] or "080027027")
suffix = "100"
ip = "#{ip_prefix}#{suffix}"
config.vm.box = "oneiric"
config.vm.box_url = "http://images.ansolabs.com/vagrant/oneiric64.box"
config.vm.customize ['modifyvm', :id, '--memory', '2048']
config.vm.network :hostonly, ip, :mac => "#{mac_prefix}#{suffix}"
config.vm.share_folder("v-cache", "/home/vagrant/cache", cachedir, :nfs => true)
config.vm.share_folder("v-ssh", "/home/vagrant/.host-ssh", sshdir)
config.vm.share_folder("v-dev", "/home/vagrant/Devel", "/Users/dhellmann/Documents/Devel/nova-docs",
:nfs => true)
config.vm.forward_port 80, 8080
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[anso::cache]",
"recipe[nova::hostname]",
"recipe[nova::source]",
#"recipe[anso::settings]", # vim / screen / git settings for testing
]
chef.json.merge!({
:nova => {
:source => {
:mysql_password => "secrete",
:rabbit_password => "secrete",
:admin_password => "secrete",
:service_token => "secrete",
:flat_interface => "eth1",
:public_interface => "eth1",
:floating_range => (ENV['FLOATING'] or "#{ip_prefix}128/28"),
:host_ip => ip,
}
},
})
end
end
#!/bin/bash
# install virtualbox
#curl -O http://download.virtualbox.org/virtualbox/4.1.4/VirtualBox-4.1.4-74291-OSX.dmg
#open VirtualBox-4.1.4-74291-OSX.dmg
# update gem and install new vagrant
sudo gem update --system
sudo gem install vagrant
# get chef scripts
#git clone git://github.com/cloudbuilders/openstack-cookbooks ~/lab/OpenStack/openstack-cookbooks
cd ~/lab/OpenStack/openstack-cookbooks && git pull
#mkdir -p ~/lab/OpenStack/devstack
cd ~/lab/OpenStack/devstack
rm Vagrantfile
curl -o Vagrantfile https://raw.github.com/gist/1961332/devstack.rb
vagrant up
# you will need to enter your password for creating nfs shares
# when it is finished you should be able to access dashboard at 10.0.5.100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment