blob: d039c3b7d151d37601ee089769da52cd45e4134b [file] [log] [blame]
Zsolt Harasztiec7df102016-05-05 13:34:18 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
Zack Williams03a20ec2017-04-12 17:39:36 -07004$cordpath = ".."
Zack Williamsa1f55082017-02-28 22:41:36 -07005
Zsolt Harasztiec7df102016-05-05 13:34:18 -07006Vagrant.configure(2) do |config|
7
Andy Bavierec9829a2017-02-05 07:58:26 -05008 config.vm.synced_folder '.', '/vagrant', disabled: true
Zsolt Harasztiec7df102016-05-05 13:34:18 -07009
10 config.vm.define "corddev" do |d|
Zsolt Haraszti5b5a42a2016-05-12 22:19:57 -070011 d.ssh.forward_agent = true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070012 d.vm.box = "ubuntu/trusty64"
13 d.vm.hostname = "corddev"
14 d.vm.network "private_network", ip: "10.100.198.200"
Zack Williamsa1f55082017-02-28 22:41:36 -070015 d.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavierf55e7f92017-06-22 10:16:44 -040016 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/cord/build/ansible/corddev.yml -c local"
17 d.vm.synced_folder $cordpath, "/opt/cord"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070018 d.vm.provider "virtualbox" do |v|
19 v.memory = 2048
20 end
Andy Bavier5c2e4fa2016-10-31 13:50:52 -040021 d.vm.provider :libvirt do |v, override|
Andy Bavier8ce395f2016-10-14 12:51:30 -040022 v.memory = 2048
Andy Bavierf55e7f92017-06-22 10:16:44 -040023 override.vm.synced_folder $cordpath, "/opt/cord", type: "nfs"
Andy Bavier99c11d32016-09-14 17:21:20 -040024 end
Zsolt Harasztiec7df102016-05-05 13:34:18 -070025 end
26
27 config.vm.define "prod" do |d|
28 d.vm.box = "ubuntu/trusty64"
29 d.vm.hostname = "prod"
Andy Bavier51584d42016-12-02 08:39:13 -050030 d.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
Zsolt Harasztiec7df102016-05-05 13:34:18 -070031 d.vm.network "private_network", ip: "10.100.198.201"
Andy Bavierf55e7f92017-06-22 10:16:44 -040032 d.vm.synced_folder $cordpath, "/opt/ciab"
Andy Bavier2505f592016-11-11 15:58:55 -050033 d.vm.network "private_network",
34 ip: "0.0.0.0",
35 auto_config: false,
36 virtualbox__intnet: "cord-mgmt-network",
37 libvirt__network_name: "cord-mgmt-network",
38 libvirt__forward_mode: "none",
39 libvirt__dhcp_enabled: false
40 d.vm.network "private_network",
Andy Bavier0f07bb32017-01-17 10:20:26 -050041 ip: "0.1.0.0",
42 mac: "02420a060101",
43 auto_config: false,
44 virtualbox__intnet: "head-node-leaf-1",
45 libvirt__network_name: "head-node-leaf-1",
46 libvirt__forward_mode: "none",
Andy Bavier2505f592016-11-11 15:58:55 -050047 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -070048 d.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavierf55e7f92017-06-22 10:16:44 -040049 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/prod.yml -c local"
50 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 cd /opt/ciab/build/platform-install; ansible-playbook -i inventory/head-localhost deploy-elasticstack-playbook.yml"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070051 d.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070052 v.memory = 2048
53 end
Andy Bavier2505f592016-11-11 15:58:55 -050054 d.vm.provider :libvirt do |v, override|
Scott Baker6f58e322016-12-09 14:47:07 -080055 v.memory = 24576
Andy Bavier2505f592016-11-11 15:58:55 -050056 v.cpus = 8
57 v.storage :file, :size => '100G', :type => 'qcow2'
Andy Bavierf55e7f92017-06-22 10:16:44 -040058 override.vm.synced_folder $cordpath, "/opt/ciab", type: "nfs"
Andy Bavierb0b5a142017-07-17 17:32:55 -070059 override.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/add-extra-drive.yml -c local -i localhost,"
David K. Bainbridged506aa62016-06-22 16:06:39 -070060 end
61 end
62
Andy Bavier0f07bb32017-01-17 10:20:26 -050063 config.vm.define "leaf-1" do |s|
64 s.vm.box = "ubuntu/trusty64"
65 s.vm.hostname = "leaf-1"
Andy Bavierf55e7f92017-06-22 10:16:44 -040066 s.vm.synced_folder $cordpath, "/opt/ciab"
Andy Bavier0f07bb32017-01-17 10:20:26 -050067 s.vm.network "private_network",
68 #type: "dhcp",
69 ip: "0.0.0.0",
70 auto_config: false,
71 virtualbox__intnet: "cord-mgmt-network",
72 libvirt__network_name: "cord-mgmt-network",
73 mac: "cc37ab000011"
74 s.vm.network "private_network",
75 ip: "0.1.0.0",
76 auto_config: false,
77 virtualbox__intnet: "head-node-leaf-1",
78 libvirt__network_name: "head-node-leaf-1",
79 libvirt__forward_mode: "none",
80 libvirt__dhcp_enabled: false
81 s.vm.network "private_network",
82 ip: "0.2.0.0",
83 auto_config: false,
84 virtualbox__intnet: "compute-node-1-leaf-1",
85 libvirt__network_name: "compute-node-1-leaf-1",
86 libvirt__forward_mode: "none",
87 libvirt__dhcp_enabled: false
88 s.vm.network "private_network",
89 ip: "0.5.0.0",
90 auto_config: false,
91 virtualbox__intnet: "leaf-1-spine-1",
92 libvirt__network_name: "leaf-1-spine-1",
93 libvirt__forward_mode: "none",
94 libvirt__dhcp_enabled: false
95 s.vm.network "private_network",
96 ip: "0.6.0.0",
97 auto_config: false,
98 virtualbox__intnet: "leaf-1-spine-2",
99 libvirt__network_name: "leaf-1-spine-2",
100 libvirt__forward_mode: "none",
101 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700102 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500103 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700104 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavierb0b5a142017-07-17 17:32:55 -0700105 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500106 else
Andy Bavierb0b5a142017-07-17 17:32:55 -0700107 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500108 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500109 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500110 v.memory = 512
111 v.cpus = 1
Andy Bavierf55e7f92017-06-22 10:16:44 -0400112 override.vm.synced_folder $cordpath, "/opt/ciab", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500113 end
114 s.vm.provider "virtualbox" do |v, override|
115 v.memory = 512
116 v.cpus = 1
117 end
118 end
119
120 config.vm.define "leaf-2" do |s|
121 s.vm.box = "ubuntu/trusty64"
122 s.vm.hostname = "leaf-2"
Andy Bavierf55e7f92017-06-22 10:16:44 -0400123 s.vm.synced_folder $cordpath, "/opt/ciab"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500124 s.vm.network "private_network",
125 #type: "dhcp",
126 ip: "0.0.0.0",
127 auto_config: false,
128 virtualbox__intnet: "cord-mgmt-network",
129 libvirt__network_name: "cord-mgmt-network",
130 mac: "cc37ab000012"
131 s.vm.network "private_network",
132 ip: "0.3.0.0",
133 auto_config: false,
134 virtualbox__intnet: "compute-node-2-leaf-2",
135 libvirt__network_name: "compute-node-2-leaf-2",
136 libvirt__forward_mode: "none",
137 libvirt__dhcp_enabled: false
138 s.vm.network "private_network",
139 ip: "0.4.0.0",
140 auto_config: false,
141 virtualbox__intnet: "compute-node-3-leaf-2",
142 libvirt__network_name: "compute-node-3-leaf-2",
143 libvirt__forward_mode: "none",
144 libvirt__dhcp_enabled: false
145 s.vm.network "private_network",
146 ip: "0.7.0.0",
147 auto_config: false,
148 virtualbox__intnet: "leaf-2-spine-1",
149 libvirt__network_name: "leaf-2-spine-1",
150 libvirt__forward_mode: "none",
151 libvirt__dhcp_enabled: false
152 s.vm.network "private_network",
153 ip: "0.8.0.0",
154 auto_config: false,
155 virtualbox__intnet: "leaf-2-spine-2",
156 libvirt__network_name: "leaf-2-spine-2",
157 libvirt__forward_mode: "none",
158 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700159 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500160 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700161 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavierb0b5a142017-07-17 17:32:55 -0700162 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/leafswitch.yml -c local -e 'fabric=true net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500163 else
Andy Bavierb0b5a142017-07-17 17:32:55 -0700164 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/leafswitch.yml -c local -e 'net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500165 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500166 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500167 v.memory = 512
168 v.cpus = 1
Andy Bavierf55e7f92017-06-22 10:16:44 -0400169 override.vm.synced_folder $cordpath, "/opt/ciab", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500170 end
171 s.vm.provider "virtualbox" do |v, override|
172 v.memory = 512
173 v.cpus = 1
174 end
175 end
176
177 config.vm.define "spine-1" do |s|
178 s.vm.box = "ubuntu/trusty64"
179 s.vm.hostname = "spine-1"
Andy Bavierf55e7f92017-06-22 10:16:44 -0400180 s.vm.synced_folder $cordpath, "/opt/ciab"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500181 s.vm.network "private_network",
182 #type: "dhcp",
183 ip: "0.0.0.0",
184 auto_config: false,
185 virtualbox__intnet: "cord-mgmt-network",
186 libvirt__network_name: "cord-mgmt-network",
187 mac: "cc37ab000021"
188 s.vm.network "private_network",
189 ip: "0.5.0.0",
190 auto_config: false,
191 virtualbox__intnet: "leaf-1-spine-1",
192 libvirt__network_name: "leaf-1-spine-1",
193 libvirt__forward_mode: "none",
194 libvirt__dhcp_enabled: false
195 s.vm.network "private_network",
196 ip: "0.7.0.0",
197 auto_config: false,
198 virtualbox__intnet: "leaf-2-spine-1",
199 libvirt__network_name: "leaf-2-spine-1",
200 libvirt__forward_mode: "none",
201 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700202 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500203 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700204 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavierb0b5a142017-07-17 17:32:55 -0700205 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500206 else
Andy Bavierb0b5a142017-07-17 17:32:55 -0700207 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500208 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500209 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500210 v.memory = 512
211 v.cpus = 1
Andy Bavierf55e7f92017-06-22 10:16:44 -0400212 override.vm.synced_folder $cordpath, "/opt/ciab", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500213 end
214 s.vm.provider "virtualbox" do |v, override|
215 v.memory = 512
216 v.cpus = 1
217 end
218 end
219
220 config.vm.define "spine-2" do |s|
221 s.vm.box = "ubuntu/trusty64"
222 s.vm.hostname = "spine-2"
Andy Bavierf55e7f92017-06-22 10:16:44 -0400223 s.vm.synced_folder $cordpath, "/opt/ciab"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500224 s.vm.network "private_network",
225 #type: "dhcp",
226 ip: "0.0.0.0",
227 auto_config: false,
228 virtualbox__intnet: "cord-mgmt-network",
229 libvirt__network_name: "cord-mgmt-network",
230 mac: "cc37ab000022"
231 s.vm.network "private_network",
232 ip: "0.6.0.0",
233 auto_config: false,
234 virtualbox__intnet: "leaf-1-spine-2",
235 libvirt__network_name: "leaf-1-spine-2",
236 libvirt__forward_mode: "none",
237 libvirt__dhcp_enabled: false
238 s.vm.network "private_network",
239 ip: "0.8.0.0",
240 auto_config: false,
241 virtualbox__intnet: "leaf-2-spine-2",
242 libvirt__network_name: "leaf-2-spine-2",
243 libvirt__forward_mode: "none",
244 libvirt__dhcp_enabled: false
Zack Williamsa1f55082017-02-28 22:41:36 -0700245 s.vm.provision :shell, path: $cordpath + "/build/scripts/bootstrap_ansible.sh"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500246 if (ENV['FABRIC'] == "1")
Zack Williamsa1f55082017-02-28 22:41:36 -0700247 s.vm.provision :shell, path: $cordpath + "/build/scripts/install.sh", args: "-3f"
Andy Bavierb0b5a142017-07-17 17:32:55 -0700248 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/spineswitch.yml -c local -e 'fabric=true net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500249 else
Andy Bavierb0b5a142017-07-17 17:32:55 -0700250 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /opt/ciab/build/ansible/spineswitch.yml -c local -e 'net_prefix=10.6.1' -i localhost,"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500251 end
Andy Bavierec9829a2017-02-05 07:58:26 -0500252 s.vm.provider :libvirt do |v, override|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500253 v.memory = 512
254 v.cpus = 1
Andy Bavierf55e7f92017-06-22 10:16:44 -0400255 override.vm.synced_folder $cordpath, "/opt/ciab", type: "nfs"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500256 end
257 s.vm.provider "virtualbox" do |v, override|
258 v.memory = 512
259 v.cpus = 1
260 end
261 end
262
Andy Bavier0f07bb32017-01-17 10:20:26 -0500263 config.vm.define "compute-node-1" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500264 c.vm.communicator = "none"
265 c.vm.hostname = "compute-node-1"
266 c.vm.network "private_network",
267 adapter: 1,
268 ip: "0.0.0.0",
269 auto_config: false,
270 virtualbox__intnet: "cord-mgmt-network",
271 libvirt__network_name: "cord-mgmt-network"
272 c.vm.network "private_network",
273 adapter: 2, # The fabric interface for each node
274 ip: "0.2.0.0",
275 auto_config: false,
276 virtualbox__intnet: "compute-node-1-leaf-1",
277 libvirt__network_name: "compute-node-1-leaf-1",
278 libvirt__forward_mode: "none",
279 libvirt__dhcp_enabled: false
280 c.vm.provider :libvirt do |v|
281 v.memory = 8192
282 v.cpus = 4
283 v.machine_virtual_size = 100
284 v.storage :file, :size => '100G', :type => 'qcow2'
285 v.boot 'network'
286 v.boot 'hd'
287 v.nested = true
288 end
289 c.vm.provider "virtualbox" do |v, override|
290 override.vm.box = "clink15/pxe"
291 v.memory = 1048
292 v.gui = "true"
293 end
294 end
295
296 config.vm.define "compute-node-2" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500297 c.vm.communicator = "none"
298 c.vm.hostname = "compute-node-2"
299 c.vm.network "private_network",
300 adapter: 1,
301 ip: "0.0.0.0",
302 auto_config: false,
303 virtualbox__intnet: "cord-mgmt-network",
304 libvirt__network_name: "cord-mgmt-network"
305 c.vm.network "private_network",
306 adapter: 2, # The fabric interface for each node
307 ip: "0.3.0.0",
308 auto_config: false,
309 virtualbox__intnet: "compute-node-2-leaf-2",
310 libvirt__network_name: "compute-node-2-leaf-2",
311 libvirt__forward_mode: "none",
312 libvirt__dhcp_enabled: false
313 c.vm.provider :libvirt do |v|
314 v.memory = 8192
315 v.cpus = 4
316 v.machine_virtual_size = 100
317 v.storage :file, :size => '100G', :type => 'qcow2'
318 v.boot 'network'
319 v.boot 'hd'
320 v.nested = true
321 end
322 c.vm.provider "virtualbox" do |v, override|
323 override.vm.box = "clink15/pxe"
324 v.memory = 1048
325 v.gui = "true"
326 end
327 end
328
329 config.vm.define "compute-node-3" do |c|
Andy Bavier0f07bb32017-01-17 10:20:26 -0500330 c.vm.communicator = "none"
331 c.vm.hostname = "compute-node-3"
332 c.vm.network "private_network",
333 adapter: 1,
334 ip: "0.0.0.0",
335 auto_config: false,
336 virtualbox__intnet: "cord-mgmt-network",
337 libvirt__network_name: "cord-mgmt-network"
338 c.vm.network "private_network",
339 adapter: 2, # The fabric interface for each node
340 ip: "0.4.0.0",
341 auto_config: false,
342 virtualbox__intnet: "compute-node-3-leaf-2",
343 libvirt__network_name: "compute-node-3-leaf-2",
344 libvirt__forward_mode: "none",
345 libvirt__dhcp_enabled: false
346 c.vm.provider :libvirt do |v|
347 v.memory = 8192
348 v.cpus = 4
349 v.machine_virtual_size = 100
350 v.storage :file, :size => '100G', :type => 'qcow2'
351 v.boot 'network'
352 v.boot 'hd'
353 v.nested = true
354 end
355 c.vm.provider "virtualbox" do |v, override|
356 override.vm.box = "clink15/pxe"
357 v.memory = 1048
358 v.gui = "true"
Andy Bavier99c11d32016-09-14 17:21:20 -0400359 end
360 end
361
Zsolt Harasztiec7df102016-05-05 13:34:18 -0700362 if Vagrant.has_plugin?("vagrant-cachier")
363 config.cache.scope = :box
364 end
365
366end