blob: 42388e48176ee7ee2eed14dd55617e51d2822dfd [file] [log] [blame]
Zsolt Haraszti3d163532016-09-08 15:57:32 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4Vagrant.configure(2) do |config|
5
Sergio Slobodrian2f1a3f82017-05-31 10:35:00 -04006 if /cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM
7 puts("Configuring for windows")
alshabibeef9b132017-02-02 17:46:51 -08008 config.vm.synced_folder "../..", "/cord", mount_options: ["dmode=700,fmode=600"]
Sergio Slobodrian2f1a3f82017-05-31 10:35:00 -04009 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 Haraszti3d163532016-09-08 15:57:32 -070016 else
Sergio Slobodrian2f1a3f82017-05-31 10:35:00 -040017 puts("Configuring for other")
alshabibeef9b132017-02-02 17:46:51 -080018 config.vm.synced_folder "../..", "/cord"
Sergio Slobodrian2f1a3f82017-05-31 10:35:00 -040019 Box = "ubuntu/xenial64"
20 Provider = "virtualbox"
Zsolt Haraszti3d163532016-09-08 15:57:32 -070021 end
22
23 config.vm.define "voltha" do |d|
24 d.ssh.forward_agent = true
Sergio Slobodrian2f1a3f82017-05-31 10:35:00 -040025 d.vm.box = Box
Zsolt Haraszti3d163532016-09-08 15:57:32 -070026 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"
alshabibeef9b132017-02-02 17:46:51 -080029 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 Slobodrian2f1a3f82017-05-31 10:35:00 -040031 d.vm.provider Provider do |v|
Zsolt Haraszti9b485fb2016-12-26 23:11:15 -080032 v.memory = 6144
Zsolt Haraszti3d163532016-09-08 15:57:32 -070033 end
34 end
35
36 if Vagrant.has_plugin?("vagrant-cachier")
37 config.cache.scope = :box
38 end
39
40end