blob: 1b72e8c5e3b45322718752d54ac2cd4b3714a130 [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 Scandoloc2b4b522017-03-06 17:14:46 -08007 config.vm.synced_folder "../../", "/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|
16 vb.memory = "2048"
17 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
38 sudo cp /home/vagrant/cord/build/platform-install/roles/head-prologue/files/cord-http.conf /etc/apache2/conf-enabled/cord-http.conf
39
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
45 echo "127.0.0.1 xos-spa-gui" | sudo tee --append /etc/hosts > /dev/null
46 echo "127.0.0.1 xos-rest-gw" | sudo tee --append /etc/hosts > /dev/null
47 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