51 lines
2.2 KiB
Ruby
51 lines
2.2 KiB
Ruby
# -*- mode: ruby -*-
|
|
# vi: set ft=ruby :
|
|
require 'yaml'
|
|
|
|
config_file=File.expand_path(File.join(File.dirname(__FILE__), 'ubuntu-virtualbox.yml'))
|
|
settings=YAML.load_file(config_file)
|
|
|
|
VM_MEM = settings['vm_memory']
|
|
KAFKA_URL = settings['kafka_url']
|
|
# ElasticSearch URL
|
|
ES_URL = settings['elasticsearch_url']
|
|
|
|
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
|
# configures the configuration version (we support older styles for
|
|
# backwards compatibility). Please don't change it unless you know what
|
|
# you're doing.
|
|
Vagrant.configure(2) do |config|
|
|
# The most common configuration options are documented and commented below.
|
|
# For a complete reference, please see the online documentation at
|
|
# https://docs.vagrantup.com.
|
|
|
|
# Every Vagrant development environment requires a box. You can search for
|
|
# boxes at https://atlas.hashicorp.com/search.
|
|
config.vm.box = "ubuntu/trusty64"
|
|
|
|
config.vm.provider "virtualbox" do |vb|
|
|
# # Display the VirtualBox GUI when booting the machine
|
|
# vb.gui = true
|
|
#
|
|
# # Customize the amount of memory on the VM:
|
|
vb.memory = VM_MEM
|
|
config.vm.network "private_network", ip: "192.168.0.10"
|
|
end
|
|
|
|
config.vm.provision "shell", inline: <<-SHELL
|
|
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
|
|
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
|
|
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
|
|
sudo apt-get update
|
|
sudo apt-get install -y git build-essential python-pip python-dev vim
|
|
sudo apt-get install -y virtualenvwrapper
|
|
cd /vagrant && sudo git clone https://github.com/openstack/kiloeyes.git
|
|
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
|
|
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
|
|
sudo apt-get install -y oracle-java8-installer
|
|
cd /vagrant && wget #{KAFKA_URL} -O - | tar -zxvf - -C /vagrant
|
|
wget #{ES_URL} -O /tmp/es.deb && sudo dpkg -i /tmp/es.deb
|
|
echo source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh | tee -a ~/.profile
|
|
SHELL
|
|
end
|