Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | Vagrant.configure(2) do |config| |
| 5 | |
Sergio Slobodrian | 2f1a3f8 | 2017-05-31 10:35:00 -0400 | [diff] [blame] | 6 | if /cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM |
| 7 | puts("Configuring for windows") |
alshabib | eef9b13 | 2017-02-02 17:46:51 -0800 | [diff] [blame] | 8 | config.vm.synced_folder "../..", "/cord", mount_options: ["dmode=700,fmode=600"] |
Sergio Slobodrian | 2f1a3f8 | 2017-05-31 10:35:00 -0400 | [diff] [blame] | 9 | Box = "ubuntu/xenial64" |
| 10 | Provider = "virtualbox" |
| 11 | elsif RUBY_PLATFORM =~ /linux/ |
| 12 | puts("Configuring for linux") |
| 13 | config.vm.synced_folder "../..", "/cord", type: "nfs" |
| 14 | Box = "ubuntu1604" |
| 15 | Provider = "libvirt" |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 16 | else |
Sergio Slobodrian | 2f1a3f8 | 2017-05-31 10:35:00 -0400 | [diff] [blame] | 17 | puts("Configuring for other") |
alshabib | eef9b13 | 2017-02-02 17:46:51 -0800 | [diff] [blame] | 18 | config.vm.synced_folder "../..", "/cord" |
Sergio Slobodrian | 2f1a3f8 | 2017-05-31 10:35:00 -0400 | [diff] [blame] | 19 | Box = "ubuntu/xenial64" |
| 20 | Provider = "virtualbox" |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 21 | end |
| 22 | |
| 23 | config.vm.define "voltha" do |d| |
| 24 | d.ssh.forward_agent = true |
Sergio Slobodrian | 2f1a3f8 | 2017-05-31 10:35:00 -0400 | [diff] [blame] | 25 | d.vm.box = Box |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 26 | d.vm.hostname = "voltha" |
| 27 | d.vm.network "private_network", ip: "10.100.198.220" |
| 28 | d.vm.provision :shell, path: "ansible/scripts/bootstrap_ansible.sh" |
alshabib | eef9b13 | 2017-02-02 17:46:51 -0800 | [diff] [blame] | 29 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/incubator/voltha/ansible/voltha.yml -c local" |
| 30 | d.vm.provision :shell, inline: "cd /cord/incubator/voltha && source env.sh && make install-protoc && chmod 777 /tmp/fluentd" |
Sergio Slobodrian | 2f1a3f8 | 2017-05-31 10:35:00 -0400 | [diff] [blame] | 31 | d.vm.provider Provider do |v| |
Zsolt Haraszti | 9b485fb | 2016-12-26 23:11:15 -0800 | [diff] [blame] | 32 | v.memory = 6144 |
Zsolt Haraszti | 3d16353 | 2016-09-08 15:57:32 -0700 | [diff] [blame] | 33 | end |
| 34 | end |
| 35 | |
| 36 | if Vagrant.has_plugin?("vagrant-cachier") |
| 37 | config.cache.scope = :box |
| 38 | end |
| 39 | |
| 40 | end |