-
Notifications
You must be signed in to change notification settings - Fork 39
/
Vagrantfile
102 lines (94 loc) · 4.06 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", path: "resources/puppet/scripts/bootstrap.sh"
config.vm.provision "puppet" do |puppet|
puppet.hiera_config_path = "resources/puppet/hiera.yaml"
puppet.working_directory = "/vagrant/resources/puppet"
puppet.manifests_path = "resources/puppet/manifests"
puppet.manifest_file = "base.pp"
end
num_compute_nodes = (ENV['DEVSTACK_NUM_COMPUTE_NODES'] || 1).to_i
# ip configuration
control_ip = "192.168.50.20"
compute_ip_base = "192.168.50."
compute_ips = num_compute_nodes.times.collect { |n| compute_ip_base + "#{n+21}" }
config.vm.define "mininet" do |mininet|
mininet.vm.box = "trusty64"
mininet.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
mininet.vm.provider "vmware_fusion" do |v, override|
override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
end
mininet.vm.hostname = "mininet"
mininet.vm.network "private_network", ip: "192.168.50.15"
mininet.vm.provider :virtualbox do |vb|
vb.memory = 2048
end
mininet.vm.provider "vmware_fusion" do |vf|
vf.vmx["memsize"] = "2048"
end
mininet.vm.provider :libvirt do |lv|
lv.memory = 2048
end
mininet.vm.provision "puppet" do |puppet|
puppet.hiera_config_path = "resources/puppet/hiera.yaml"
puppet.working_directory = "/vagrant/resources/puppet"
puppet.manifests_path = "resources/puppet/manifests"
puppet.manifest_file = "mininet.pp"
end
end
config.vm.define "devstack-control" do |control|
control.vm.box = "trusty64"
control.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
control.vm.provider "vmware_fusion" do |v, override|
override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
end
control.vm.hostname = "devstack-control"
control.vm.network "private_network", ip: "#{control_ip}"
control.vm.network "forwarded_port", guest: 8080, host: 8081
control.vm.provider :virtualbox do |vb|
vb.memory = 4096
end
control.vm.provider "vmware_fusion" do |vf|
vf.vmx["memsize"] = "4096"
end
control.vm.provider :libvirt do |lv|
lv.memory = 4096
end
control.vm.provision "puppet" do |puppet|
puppet.hiera_config_path = "resources/puppet/hiera.yaml"
puppet.working_directory = "/vagrant/resources/puppet"
puppet.manifests_path = "resources/puppet/manifests"
puppet.manifest_file = "devstack-control.pp"
end
end
# Devstack Compute Nodes
num_compute_nodes.times do |n|
config.vm.define "devstack-compute-#{n+1}" do |compute|
compute_ip = compute_ips[n]
compute_index = n+1
compute.vm.box = "trusty64"
compute.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
compute.vm.provider "vmware_fusion" do |v, override|
override.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_ubuntu-14.04_chef-provisionerless.box"
end
compute.vm.hostname = "devstack-compute-#{compute_index}"
compute.vm.network "private_network", ip: "#{compute_ip}"
compute.vm.provider :virtualbox do |vb|
vb.memory = 4096
end
compute.vm.provider "vmware_fusion" do |vf|
vf.vmx["memsize"] = "4096"
end
compute.vm.provider :libvirt do |lv|
lv.memory = 4096
end
compute.vm.provision "puppet" do |puppet|
puppet.hiera_config_path = "resources/puppet/hiera.yaml"
puppet.working_directory = "/vagrant/resources/puppet"
puppet.manifests_path = "resources/puppet/manifests"
puppet.manifest_file = "devstack-compute.pp"
end
end
end
end