blob: ec4565a1b81abeeb097c2bd6144e8eb2beb931a9 [file] [log] [blame]
Zsolt Harasztiec7df102016-05-05 13:34:18 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4Vagrant.configure(2) do |config|
5
6 if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
alshabibb6ae0862016-08-26 10:55:48 -07007 config.vm.synced_folder "..", "/cord", mount_options: ["dmode=700,fmode=600"]
Zsolt Harasztiec7df102016-05-05 13:34:18 -07008 else
alshabibb6ae0862016-08-26 10:55:48 -07009 config.vm.synced_folder "..", "/cord"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070010 end
11
12 config.vm.define "corddev" do |d|
Zsolt Haraszti5b5a42a2016-05-12 22:19:57 -070013 d.ssh.forward_agent = true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070014 d.vm.box = "ubuntu/trusty64"
15 d.vm.hostname = "corddev"
16 d.vm.network "private_network", ip: "10.100.198.200"
17 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070018 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070019 d.vm.provider "virtualbox" do |v|
20 v.memory = 2048
21 end
22 end
23
24 config.vm.define "prod" do |d|
25 d.vm.box = "ubuntu/trusty64"
David K. Bainbridged506aa62016-06-22 16:06:39 -070026 d.vm.synced_folder '.', '/vagrant', disable: true
Zsolt Harasztiec7df102016-05-05 13:34:18 -070027 d.vm.hostname = "prod"
28 d.vm.network "private_network", ip: "10.100.198.201"
David K. Bainbridge6f2cbe72016-08-19 15:48:07 -070029 d.vm.network "private_network", ip: "0.0.0.0", virtualbox__intnet: "cord-test-network"
30 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070031 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/prod.yml -c local"
Zsolt Harasztiec7df102016-05-05 13:34:18 -070032 d.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070033 v.memory = 2048
34 end
35 end
36
David K. Bainbridged506aa62016-06-22 16:06:39 -070037 config.vm.define "switch" do |s|
38 s.vm.box = "ubuntu/trusty64"
39 s.vm.hostname = "fakeswitch"
40 s.vm.network "private_network", ip: "10.100.198.253"
41 s.vm.network "private_network",
42 type: "dhcp",
43 virtualbox__intnet: "cord-test-network",
44 mac: "cc37ab000001"
45 s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
alshabibb6ae0862016-08-26 10:55:48 -070046 s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/fakeswitch.yml -c local"
David K. Bainbridged506aa62016-06-22 16:06:39 -070047 s.vm.provider "virtualbox" do |v|
David K. Bainbridge97b3f2f2016-06-16 18:08:49 -070048 v.memory = 1048
David K. Bainbridged506aa62016-06-22 16:06:39 -070049 v.name = "fakeswitch"
50 end
51 end
52
alshabibcb8e09b2016-09-06 11:41:29 -070053 config.vm.define "testbox" do |d|
54 d.vm.box = "fgrehm/trusty64-lxc"
55 d.ssh.forward_agent = true
56 d.vm.hostname = "testbox"
57 d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
58 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
59 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
60 config.vm.provider :lxc do |lxc|
61 # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
62 lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
63 end
64 end
65
alshabib26309c32016-09-02 18:04:16 -070066
David K. Bainbridged506aa62016-06-22 16:06:39 -070067 (1..3).each do |i|
68 # Defining VM properties
69 config.vm.define "compute_node#{i}" do |c|
70 c.vm.box = "clink15/pxe"
71 c.vm.synced_folder '.', '/vagrant', disable: true
72 c.vm.communicator = "none"
73 c.vm.hostname = "computenode"
74 c.vm.network "private_network",
75 adapter: "1",
76 type: "dhcp",
77 auto_config: false,
78 virtualbox__intnet: "cord-test-network"
79 c.vm.provider "virtualbox" do |v|
80 v.name = "compute_node#{i}"
81 v.memory = 1048
82 v.gui = "true"
83 end
Zsolt Harasztiec7df102016-05-05 13:34:18 -070084 end
85 end
86
87 if Vagrant.has_plugin?("vagrant-cachier")
88 config.cache.scope = :box
89 end
90
91end