1 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
2 VAGRANTFILE_API_VERSION = "2"
4 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
6 config.vm.box = "trusty64"
7 config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
8 config.vm.provider "vmware_fusion" do |v, override|
9 override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
12 config.vm.provision "shell", path: "resources/puppet/scripts/bootstrap.sh"
14 config.vm.provision "puppet" do |puppet|
15 puppet.hiera_config_path = "resources/puppet/hiera.yaml"
16 puppet.working_directory = "/vagrant/resources/puppet"
17 puppet.manifests_path = "resources/puppet/manifests"
18 puppet.manifest_file = "base.pp"
21 num_compute_nodes = (ENV['DEVSTACK_NUM_COMPUTE_NODES'] || 1).to_i
24 control_ip = "192.168.50.20"
25 compute_ip_base = "192.168.50."
26 compute_ips = num_compute_nodes.times.collect { |n| compute_ip_base + "#{n+21}" }
28 config.vm.define "devstack-control" do |control|
29 control.vm.hostname = "devstack-control"
30 control.vm.network "private_network", ip: "#{control_ip}"
31 control.vm.network "forwarded_port", guest: 8080, host: 8081
32 control.vm.provider :virtualbox do |vb|
35 control.vm.provider "vmware_fusion" do |vf|
36 vf.vmx["memsize"] = "4096"
38 control.vm.provider :libvirt do |lv|
41 control.vm.provision "puppet" do |puppet|
42 puppet.hiera_config_path = "resources/puppet/hiera.yaml"
43 puppet.working_directory = "/vagrant/resources/puppet"
44 puppet.manifests_path = "resources/puppet/manifests"
45 puppet.manifest_file = "devstack-control.pp"
49 # Devstack Compute Nodes
50 num_compute_nodes.times do |n|
51 config.vm.define "devstack-compute-#{n+1}" do |compute|
52 compute_ip = compute_ips[n]
54 compute.vm.hostname = "devstack-compute-#{compute_index}"
55 compute.vm.network "private_network", ip: "#{compute_ip}"
56 compute.vm.provider :virtualbox do |vb|
59 compute.vm.provider "vmware_fusion" do |vf|
60 vf.vmx["memsize"] = "4096"
62 compute.vm.provider :libvirt do |lv|
65 compute.vm.provision "puppet" do |puppet|
66 puppet.hiera_config_path = "resources/puppet/hiera.yaml"
67 puppet.working_directory = "/vagrant/resources/puppet"
68 puppet.manifests_path = "resources/puppet/manifests"
69 puppet.manifest_file = "devstack-compute.pp"