blob: 099337dc30bcce1eec576e278c8b3d15459ca3d5 [file] [log] [blame]
Matteo Scandolobf5b6a12017-02-13 11:25:07 -08001Vagrant.configure("2") do |config|
2 # base image
3 config.vm.box = "ubuntu/trusty64"
4
5 # share the folder
6 config.vm.synced_folder "../../", "/home/vagrant/cord/", create: true
Matteo Scandolob03806c2017-03-07 16:17:53 -08007 config.vm.synced_folder "./cord_profile", "/home/vagrant/cord_profile/", create: true
Matteo Scandolobf5b6a12017-02-13 11:25:07 -08008 config.vm.synced_folder ".", "/vagrant", disabled: true
9
10 # set the frontend vm
11 config.vm.define "head-node" do |d|
12 d.vm.network "forwarded_port", guest: 9999, host: 9999
13 d.vm.network "forwarded_port", guest: 6379, host: 6379
14 d.vm.network "private_network", ip: "192.168.46.100"
15 d.vm.provider "virtualbox" do |vb|
Matteo Scandolo4b3d7682017-03-27 10:34:24 -070016 vb.memory = "4096"
Matteo Scandolobf5b6a12017-02-13 11:25:07 -080017 vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
18 vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
19 end
20 end
21
22 config.vm.provision "shell", privileged: false, inline: <<-SHELL
Matteo Scandolo667334f2017-02-26 10:58:08 -080023 # Setup CORD tools
Matteo Scandolobf5b6a12017-02-13 11:25:07 -080024 curl -o ~/cord-bootstrap.sh https://raw.githubusercontent.com/opencord/platform-install/master/scripts/cord-bootstrap.sh
25 bash cord-bootstrap.sh
26 ssh-keygen -t rsa -N "" -f .ssh/id_rsa
27 cp ~/.ssh/id_rsa node_key
Matteo Scandolo667334f2017-02-26 10:58:08 -080028
29 # Install apache
30 sudo apt-get update
31 sudo apt-get install -y apache2 libapache2-mod-fastcgi apache2-mpm-worker
32 sudo a2enmod proxy_http
33 sudo a2enmod headers
34 sudo a2enmod rewrite
35 sudo a2enmod proxy_wstunnel
36
37 # Copy apache conf
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070038 sudo cp /home/vagrant/cord/build/platform-install/roles/apache-proxy/files/cord-http.conf /etc/apache2/conf-enabled/cord-http.conf
Matteo Scandolo667334f2017-02-26 10:58:08 -080039
40 # Reload Apache
41 sudo service apache2 reload
42
43 # Add hosts
44 echo "127.0.0.1 xos" | sudo tee --append /etc/hosts > /dev/null
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070045 echo "127.0.0.1 xos-gui" | sudo tee --append /etc/hosts > /dev/null
46 echo "127.0.0.1 xos-ws" | sudo tee --append /etc/hosts > /dev/null
Matteo Scandolo667334f2017-02-26 10:58:08 -080047 echo "127.0.0.1 xos-chameleon" | sudo tee --append /etc/hosts > /dev/null
48 echo "127.0.0.1 xos-core" | sudo tee --append /etc/hosts > /dev/null
Matteo Scandolobf5b6a12017-02-13 11:25:07 -080049 SHELL
50
51 end