Taiga Vagrantfile that works on OSX and others
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require "./source.rb" | |
ROOT_PATH = File.dirname(__FILE__) | |
VAGRANTFILE_API_VERSION = "2" | |
# Look for a Vagrantfile.local to load | |
local_vagrantfile = "#{__FILE__}.local" | |
if File.exists?(local_vagrantfile) | |
eval File.read(local_vagrantfile) | |
end | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "trusty64" | |
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" | |
config.vm.network :forwarded_port, host: 8000, guest: 8000 | |
config.vm.network :forwarded_port, host: 9001, guest: 9001 | |
config.ssh.forward_agent = true | |
config.vm.synced_folder "./data", "/home/vagrant/data" | |
config.vm.provider "virtualbox" do |vb| | |
# Boot with headless mode | |
vb.gui = false | |
host = RbConfig::CONFIG['host_os'] | |
#SB: Below doesn't work on OSX and is meant for linux only hence im setting memory and cores allocated to vm manually | |
#cpus = `nproc`.to_i | |
# meminfo shows KB and we need to convert to MB | |
#mem = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 4 | |
vb.memory = 1024 | |
vb.cpus = 2 | |
end | |
# Provisioning | |
config.vm.provision "shell" do |shell| | |
vagrant_shell_scripts_configure( | |
shell, | |
File.join(ROOT_PATH, "scripts"), | |
"provision.sh", | |
{} | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment