Last active
August 29, 2015 14:00
-
-
Save ace-subido/a37bc268c96ad9e8d619 to your computer and use it in GitHub Desktop.
Development Workflow: Basic Vagrantfile template
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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