Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | Vagrant.configure(2) do |config| |
| 5 | |
| 6 | if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil |
Zsolt Haraszti | 5dc859d | 2016-05-31 17:11:40 -0700 | [diff] [blame] | 7 | config.vm.synced_folder ".", "/cord", mount_options: ["dmode=700,fmode=600"] |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 8 | else |
Zsolt Haraszti | 5dc859d | 2016-05-31 17:11:40 -0700 | [diff] [blame] | 9 | config.vm.synced_folder ".", "/cord" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 10 | end |
| 11 | |
| 12 | config.vm.define "corddev" do |d| |
Zsolt Haraszti | 5b5a42a | 2016-05-12 22:19:57 -0700 | [diff] [blame] | 13 | d.ssh.forward_agent = true |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 14 | 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" |
Zsolt Haraszti | 5dc859d | 2016-05-31 17:11:40 -0700 | [diff] [blame] | 18 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/ansible/corddev.yml -c local" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 19 | 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. Bainbridge | d506aa6 | 2016-06-22 16:06:39 -0700 | [diff] [blame] | 26 | d.vm.synced_folder '.', '/vagrant', disable: true |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 27 | d.vm.hostname = "prod" |
| 28 | d.vm.network "private_network", ip: "10.100.198.201" |
David K. Bainbridge | d506aa6 | 2016-06-22 16:06:39 -0700 | [diff] [blame] | 29 | d.vm.network "private_network", ip: "10.1.0.1", virtualbox__intnet: "cord-test-network" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 30 | d.vm.provider "virtualbox" do |v| |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 31 | v.memory = 2048 |
| 32 | end |
| 33 | end |
| 34 | |
David K. Bainbridge | d506aa6 | 2016-06-22 16:06:39 -0700 | [diff] [blame] | 35 | config.vm.define "switch" do |s| |
| 36 | s.vm.box = "ubuntu/trusty64" |
| 37 | s.vm.hostname = "fakeswitch" |
| 38 | s.vm.network "private_network", ip: "10.100.198.253" |
| 39 | s.vm.network "private_network", |
| 40 | type: "dhcp", |
| 41 | virtualbox__intnet: "cord-test-network", |
| 42 | mac: "cc37ab000001" |
| 43 | s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
| 44 | s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/ansible/fakeswitch.yml -c local" |
| 45 | s.vm.provider "virtualbox" do |v| |
David K. Bainbridge | 97b3f2f | 2016-06-16 18:08:49 -0700 | [diff] [blame] | 46 | v.memory = 1048 |
David K. Bainbridge | d506aa6 | 2016-06-22 16:06:39 -0700 | [diff] [blame] | 47 | v.name = "fakeswitch" |
| 48 | end |
| 49 | end |
| 50 | |
| 51 | (1..3).each do |i| |
| 52 | # Defining VM properties |
| 53 | config.vm.define "compute_node#{i}" do |c| |
| 54 | c.vm.box = "clink15/pxe" |
| 55 | c.vm.synced_folder '.', '/vagrant', disable: true |
| 56 | c.vm.communicator = "none" |
| 57 | c.vm.hostname = "computenode" |
| 58 | c.vm.network "private_network", |
| 59 | adapter: "1", |
| 60 | type: "dhcp", |
| 61 | auto_config: false, |
| 62 | virtualbox__intnet: "cord-test-network" |
| 63 | c.vm.provider "virtualbox" do |v| |
| 64 | v.name = "compute_node#{i}" |
| 65 | v.memory = 1048 |
| 66 | v.gui = "true" |
| 67 | end |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 68 | end |
| 69 | end |
| 70 | |
| 71 | if Vagrant.has_plugin?("vagrant-cachier") |
| 72 | config.cache.scope = :box |
| 73 | end |
| 74 | |
| 75 | end |