Skip to content

Instantly share code, notes, and snippets.

@ace-subido
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ace-subido/a37bc268c96ad9e8d619 to your computer and use it in GitHub Desktop.
Save ace-subido/a37bc268c96ad9e8d619 to your computer and use it in GitHub Desktop.
Development Workflow: Basic Vagrantfile template
# You have to find this version of Debian box.
# box_url: ""
box_url: "/path/to/your/Debian/precise32.box"
ip: "192.168.43.10"
cpus: 1
memory: 512
require "yaml"
CONFIG = YAML.load_file(File.expand_path("../config/vagrant.yml", __FILE__))
VM_BOX = "yourapp-box"
VM_BOX_URL = CONFIG["box_url"]
VM_IP_ADDRESS = CONFIG["ip"]
VM_MEMORY = CONFIG["memory"]
VM_CPU = CONFIG["cpus"]
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = VM_BOX
config.vm.box_url = VM_BOX_URL
config.vm.network "private_network", ip: VM_IP_ADDRESS
config.ssh.forward_agent = true
config.vm.synced_folder "./", "/home/vagrant/yourapp", nfs: true
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", VM_MEMORY]
v.customize ["modifyvm", :id, "--cpus", VM_CPU]
v.customize ["modifyvm", :id, "--ioapic", "on"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment