2017-03-03 15:45:04 +01:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
|
2017-03-07 12:55:06 +01:00
|
|
|
# libretime web interface
|
2017-03-08 12:39:59 +01:00
|
|
|
config.vm.network "forwarded_port", guest: 8080, host:8080
|
2017-03-07 12:55:06 +01:00
|
|
|
# icecast2
|
|
|
|
config.vm.network "forwarded_port", guest: 8000, host:8000
|
2017-03-07 15:15:16 +01:00
|
|
|
# liquidsoap input harbors for instreaming (ie. /master)
|
|
|
|
config.vm.network "forwarded_port", guest: 8001, host:8001
|
2017-03-15 04:03:37 +01:00
|
|
|
config.vm.network "forwarded_port", guest: 8002, host:8002
|
|
|
|
# mkdocs documentation
|
2017-03-03 15:45:04 +01:00
|
|
|
config.vm.network "forwarded_port", guest: 8888, host:8888
|
2017-03-15 04:03:37 +01:00
|
|
|
|
2017-03-03 15:45:04 +01:00
|
|
|
|
2017-03-08 12:39:59 +01:00
|
|
|
# make sure we are using nfs (doesn't work out of the box with debian)
|
|
|
|
config.vm.synced_folder ".", "/vagrant", type: "nfs"
|
|
|
|
# private network for nfs
|
|
|
|
config.vm.network "private_network", ip: "192.168.10.100"
|
|
|
|
|
2017-03-07 12:18:34 +01:00
|
|
|
config.vm.provider "virtualbox" do |v|
|
|
|
|
# to run without OOMing we need at least 1GB of RAM
|
|
|
|
v.memory = 1024
|
2017-03-07 15:13:26 +01:00
|
|
|
|
|
|
|
# enable audio drivers on VM settings
|
|
|
|
# pinched from https://github.com/GeoffreyPlitt/vagrant-audio
|
|
|
|
config.vm.provider :virtualbox do |vb|
|
|
|
|
if RUBY_PLATFORM =~ /darwin/
|
|
|
|
vb.customize ["modifyvm", :id, '--audio', 'coreaudio', '--audiocontroller', 'hda'] # choices: hda sb16 ac97
|
|
|
|
elsif RUBY_PLATFORM =~ /mingw|mswin|bccwin|cygwin|emx/
|
|
|
|
vb.customize ["modifyvm", :id, '--audio', 'dsound', '--audiocontroller', 'ac97']
|
|
|
|
end
|
|
|
|
end
|
2017-03-07 12:18:34 +01:00
|
|
|
end
|
|
|
|
|
2017-03-08 12:39:59 +01:00
|
|
|
# default installer args used for all distros
|
|
|
|
installer_args="--force --in-place --verbose --postgres --apache --icecast "
|
|
|
|
|
|
|
|
# define all the OS boxes we support
|
2017-04-12 18:51:36 +02:00
|
|
|
config.vm.define "ubuntu-xenial" do |os|
|
|
|
|
os.vm.box = "bento/ubuntu-16.04"
|
|
|
|
provision_libretime(os, "ubuntu.sh", installer_args + "--distribution=ubuntu --release=xenial")
|
|
|
|
end
|
|
|
|
config.vm.define "ubuntu-trusty" do |os|
|
|
|
|
os.vm.box = "bento/ubuntu-14.04"
|
|
|
|
provision_libretime(os, "ubuntu.sh", installer_args + "--distribution=ubuntu --release=trusty")
|
|
|
|
end
|
2017-03-08 12:39:59 +01:00
|
|
|
config.vm.define "ubuntu" do |os|
|
2017-04-12 18:51:36 +02:00
|
|
|
STDERR.puts 'WARNING: The "ubuntu" option is deprecated. Please migrate to "ubuntu-trusty".'
|
|
|
|
STDERR.puts
|
2017-03-08 12:39:59 +01:00
|
|
|
os.vm.box = "ubuntu/trusty64"
|
|
|
|
provision_libretime(os, "ubuntu.sh", installer_args + "--distribution=ubuntu --release=trusty")
|
|
|
|
end
|
2017-04-19 20:42:12 +02:00
|
|
|
config.vm.define "debian-jessie" do |os|
|
|
|
|
os.vm.box = "bento/debian-8.7"
|
|
|
|
provision_libretime(os, "debian.sh", installer_args + "--distribution=debian --release=jessie")
|
|
|
|
end
|
|
|
|
config.vm.define "debian-wheezy" do |os|
|
|
|
|
os.vm.box = "bento/debian-7.11"
|
|
|
|
provision_libretime(os, "debian.sh", installer_args + "--distribution=debian --release=wheezy")
|
|
|
|
end
|
2017-03-08 12:39:59 +01:00
|
|
|
config.vm.define "debian" do |os|
|
2017-04-19 20:42:12 +02:00
|
|
|
STDERR.puts 'WARNING: The "debian" option is deprecated. Please migrate to "debian-jessie".'
|
|
|
|
STDERR.puts
|
2017-03-08 12:39:59 +01:00
|
|
|
os.vm.box = "debian/jessie64"
|
|
|
|
provision_libretime(os, "debian.sh", installer_args + "--distribution=debian --release=jessie")
|
|
|
|
end
|
|
|
|
config.vm.define "centos" do |os|
|
|
|
|
os.vm.box = 'centos/7'
|
2017-03-13 14:10:29 +01:00
|
|
|
provision_libretime(os, "centos.sh", installer_args + "--ignore-dependencies --distribution=centos --web-user=apache --selinux")
|
2017-03-08 12:39:59 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def provision_libretime(config, prepare_script, installer_args)
|
|
|
|
# Prepare OS
|
|
|
|
config.vm.provision "prepare", type: "shell", path: "installer/vagrant/%s" % prepare_script
|
|
|
|
|
|
|
|
# Provision LibreTime
|
|
|
|
config.vm.provision "install", type: "shell", inline: "cd /vagrant; ./install %s --web-port=8080" % installer_args
|
|
|
|
|
|
|
|
# Provision docs
|
|
|
|
config.vm.provision "install-mkdocs", type: "shell", path: "docs/scripts/install.sh"
|
|
|
|
config.vm.provision "start-mkdocs", type: "shell", path: "docs/scripts/serve.sh"
|
|
|
|
end
|
2017-03-03 15:45:04 +01:00
|
|
|
|
|
|
|
end
|