Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
airtime backend vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
MEMORY = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 2
CPUS = `sysctl -n hw.ncpu`.to_i
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if ENV['VM'] == "virtualbox"
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v, override|
v.memory = MEMORY
v.cpus = CPUS
end
else
config.vm.box = "parallels/ubuntu-14.04"
config.vm.provider "parallels" do |v, override|
v.update_guest_tools = true
v.memory = MEMORY
v.cpus = CPUS
end
end
config.ssh.forward_agent = true
config.vm.provision "ansible" do |ansible|
if ENV["VAULT_PASSWORD_FILE"] == nil
ansible.ask_vault_pass = true
else
ansible.vault_password_file = ENV["VAULT_PASSWORD_FILE"]
end
if ENV["e"] == "test"
ansible.playbook = "ansible/vagrant/test.yml"
elsif ENV["e"] == "web"
ansible.playbook = "ansible/vagrant/web.yml"
elsif ENV["e"] == "full"
ansible.playbook = "ansible/vagrant/full.yml"
else
ansible.playbook = "ansible/vagrant/provision.yml"
end
end
config.vm.network :forwarded_port, host: <port>, guest: <port> #airtime container
config.vm.network :forwarded_port, host: <port>, guest: <port> #airtime container
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment