Created
February 27, 2015 19:20
-
-
Save joekr/20e26b5dc218ca12ab37 to your computer and use it in GitHub Desktop.
Vagrant
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# 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 = 'hashicorp/precise64' | |
# Configurate the virtual machine to use 2GB of RAM | |
config.vm.provider :virtualbox do |vb, override| | |
vb.customize ['modifyvm', :id, '--memory', '2048'] | |
# vb.customize ["modifyvm", :id, "--cpus", 4] | |
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on'] | |
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on'] | |
override.vm.network 'private_network', ip: '192.168.50.15' | |
override.hostsupdater.remove_on_suspend = true | |
override.hostsupdater.aliases = ['my_project.dev'] | |
end | |
config.omnibus.chef_version = :latest | |
config.ssh.forward_agent = true | |
config.vm.synced_folder '.', '/vagrant', nfs: true | |
config.vm.provision :chef_solo do |chef| | |
chef.cookbooks_path = ['cookbooks', 'site-cookbooks'] | |
chef.add_recipe 'apt' | |
chef.add_recipe 'ruby_build' | |
chef.add_recipe 'rvm::user' | |
chef.add_recipe 'vim' | |
chef.add_recipe 'mysql::server' | |
chef.add_recipe 'mysql::client' | |
chef.add_recipe 'nodejs::npm' | |
chef.json = { | |
rvm: { | |
rvmrc: { | |
rvm_autolibs_flag: 'disabled' | |
}, | |
user_installs: [{ | |
rubies: ['2.2.0'], | |
default_ruby: 'ruby-2.2.0', | |
user: 'vagrant', | |
code: 'rvm use 2.2.0', | |
global_gems: [{name: 'rake'}, {name: 'bundler'}] | |
}] | |
}, | |
mysql: { | |
server_root_password: 'password' | |
}, | |
} | |
end | |
config.vm.provision 'shell', inline: 'sudo npm install bower -g' | |
config.vm.provision 'shell', inline: 'sudo apt-get -y install libxrender1' | |
config.vm.provision 'shell', inline: 'sudo apt-get -y install libmagickwand-dev' | |
config.vm.provision 'shell', inline: 'sudo apt-get -y install imagemagick' | |
config.vm.provision 'shell', inline: 'sudo apt-get -y install libfontconfig1' | |
config.vm.provision 'shell', inline: 'echo "cd /vagrant" >> /home/vagrant/.bashrc', privileged: false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment