Skip to content

Instantly share code, notes, and snippets.

@colbywhite
Last active May 20, 2016 03:51
Show Gist options
  • Save colbywhite/0e50e47894a736eaad56dca20a3959bd to your computer and use it in GitHub Desktop.
Save colbywhite/0e50e47894a736eaad56dca20a3959bd to your computer and use it in GitHub Desktop.
Vagrantfile for nodejs
source 'https://supermarket.chef.io'
cookbook 'nodejs'
# -*- mode: ruby -*-
# vi: set ft=ruby :
NODE_VERSION = '4.2.1'
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty64'
config.berkshelf.enabled = true
# config.vm.network 'forwarded_port', guest: 80, host: 8080
config.vm.network 'private_network', ip: '192.168.33.10'
# config.vm.synced_folder '../data', '/vagrant_data'
# config.vm.provider 'virtualbox' do |vb|
# vb.gui = true
# vb.memory = '1024'
# end
config.vm.provision :chef_solo do |chef|
# newer versions of chef are in legacy mode by default, thus breaking vagrant. so rollback the version
# See https://github.com/chef/chef/issues/4948
chef.version = '12.10.40'
# the fix will be in later versions of vagrant, but it is not yet release
# See https://github.com/mitchellh/vagrant/pull/7327
#chef.legacy_mode = false
chef.add_recipe 'nodejs'
chef.json = { nodejs: {
version: NODE_VERSION,
install_method: 'binary',
binary: {
# get the checksum for node-vYOUR_VERSION-linux-x64.tar.gz
# from https://nodejs.org/dist/vYOUR_VERSION/SHASUMS256.txt
checksum: 'e766e387934e17daaad92d0460ed76f756655da62b627a5c9cc07faea4a0b824'
}
}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment