Matteo Scandolo | bf5b6a1 | 2017-02-13 11:25:07 -0800 | [diff] [blame] | 1 | Vagrant.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 |
| 7 | config.vm.synced_folder ".", "/vagrant", disabled: true |
| 8 | |
| 9 | # set the frontend vm |
| 10 | config.vm.define "head-node" do |d| |
| 11 | d.vm.network "forwarded_port", guest: 9999, host: 9999 |
| 12 | d.vm.network "forwarded_port", guest: 6379, host: 6379 |
| 13 | d.vm.network "private_network", ip: "192.168.46.100" |
| 14 | d.vm.provider "virtualbox" do |vb| |
| 15 | vb.memory = "2048" |
| 16 | vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] |
| 17 | vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] |
| 18 | end |
| 19 | end |
| 20 | |
| 21 | config.vm.provision "shell", privileged: false, inline: <<-SHELL |
Matteo Scandolo | 667334f | 2017-02-26 10:58:08 -0800 | [diff] [blame] | 22 | # Setup CORD tools |
Matteo Scandolo | bf5b6a1 | 2017-02-13 11:25:07 -0800 | [diff] [blame] | 23 | curl -o ~/cord-bootstrap.sh https://raw.githubusercontent.com/opencord/platform-install/master/scripts/cord-bootstrap.sh |
| 24 | bash cord-bootstrap.sh |
| 25 | ssh-keygen -t rsa -N "" -f .ssh/id_rsa |
| 26 | cp ~/.ssh/id_rsa node_key |
Matteo Scandolo | 667334f | 2017-02-26 10:58:08 -0800 | [diff] [blame] | 27 | |
| 28 | # Install apache |
| 29 | sudo apt-get update |
| 30 | sudo apt-get install -y apache2 libapache2-mod-fastcgi apache2-mpm-worker |
| 31 | sudo a2enmod proxy_http |
| 32 | sudo a2enmod headers |
| 33 | sudo a2enmod rewrite |
| 34 | sudo a2enmod proxy_wstunnel |
| 35 | |
| 36 | # Copy apache conf |
| 37 | sudo cp /home/vagrant/cord/build/platform-install/roles/head-prologue/files/cord-http.conf /etc/apache2/conf-enabled/cord-http.conf |
| 38 | |
| 39 | # Reload Apache |
| 40 | sudo service apache2 reload |
| 41 | |
| 42 | # Add hosts |
| 43 | echo "127.0.0.1 xos" | sudo tee --append /etc/hosts > /dev/null |
| 44 | echo "127.0.0.1 xos-spa-gui" | sudo tee --append /etc/hosts > /dev/null |
| 45 | echo "127.0.0.1 xos-rest-gw" | sudo tee --append /etc/hosts > /dev/null |
| 46 | echo "127.0.0.1 xos-chameleon" | sudo tee --append /etc/hosts > /dev/null |
| 47 | echo "127.0.0.1 xos-core" | sudo tee --append /etc/hosts > /dev/null |
Matteo Scandolo | bf5b6a1 | 2017-02-13 11:25:07 -0800 | [diff] [blame] | 48 | SHELL |
| 49 | |
| 50 | end |