Skip to content

Instantly share code, notes, and snippets.

@shabbirh
Forked from ianmstew/Vagrantfile
Last active August 29, 2015 14:24
Show Gist options
  • Save shabbirh/1e61b7cfcd99c49ef79e to your computer and use it in GitHub Desktop.
Save shabbirh/1e61b7cfcd99c49ef79e to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
require "rbconfig"
HOST_NAME = "prerender"
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# VirtualBox VM by default
config.vm.box = "ubuntu/trusty64"
config.vm.box_url = "https://vagrantcloud.com/ubuntu/trusty64"
# Override if Parallels
config.vm.provider "parallels" do |v, override|
override.vm.box = "parallels/ubuntu-14.04"
override.vm.box_url = "https://vagrantcloud.com/parallels/ubuntu-14.04"
end
config.vm.hostname = HOST_NAME
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.network "private_network", ip: "10.20.30.40"
# Develop on host as usual, run under VM
config.vm.synced_folder "../src", "/opt/prerender", type: "nfs"
# Virtualbox-specific configuration
config.vm.provider :virtualbox do |vm|
vm.name = HOST_NAME
# Use VBoxManage to customize the VM. For example, to change memory and
# allow symlinks to be created in the shared folder (ex: node_modules):
vm.customize ["modifyvm", :id, "--memory", "1024"]
vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/prerender", "1"]
end
# Parallels-specific configuration
config.vm.provider :parallels do |vm|
vm.name = HOST_NAME
# Auto-update Parallels Tools on the VM (takes a few minutes)
vm.update_guest_tools = true
vm.optimize_power_consumption = false
vm.memory = 1024
vm.cpus = 2
end
# Install's latest version of Chef using vagrant-omnibus plugin.
config.omnibus.chef_version = :latest
# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "nodejs"
chef.add_recipe "prerender"
chef.json = {
"nodejs" => {
"version" => "0.10.30"
}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment