Skip to content

Instantly share code, notes, and snippets.

@colinsurprenant
Created March 9, 2013 20:45
Show Gist options
  • Save colinsurprenant/5125672 to your computer and use it in GitHub Desktop.
Save colinsurprenant/5125672 to your computer and use it in GitHub Desktop.
Vagrant & Chef-Solo configuration for: rbenv with both MRI Ruby 1.9.3 and JRuby 1.7.3 with Bundler gem installed, MySQL, Redis, Nginx, Node.js & npm, Java OpenJDK 1.7, git and the build-essential tools.
{
"groups": [
"sysadmin"
],
"comment": "Colin Surprenant",
"password": "xxx",
"ssh_keys": [
"ssh-rsa xxx"
],
"id": "colin",
"shell": "/bin/bash",
"email": "[email protected]"
}
List of clonable github urls for the cookbooks. Note that the cookbook directory name must match the Vagrantfile decralarion. For example nodejs-cookbook must be "nodejs".
git://github.com/opscode-cookbooks/apt.git
git://github.com/opscode-cookbooks/build-essential.git
git://github.com/opscode-cookbooks/git.git
git://github.com/opscode-cookbooks/java.git
git://github.com/opscode-cookbooks/mysql.git
git://github.com/opscode-cookbooks/nginx.git
git://github.com/opscode-cookbooks/ohai.git
git://github.com/mdxp/nodejs-cookbook.git
git://github.com/fnichol/chef-rbenv.git
git://github.com/fnichol/chef-ruby_build.git
git://github.com/brianbianco/redisio.git
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "quantal64_vb428"
config.vm.customize ["modifyvm", :id, "--memory", 512]
config.ssh.forward_agent = true
config.vm.provision :chef_solo do |chef|
# chef.log_level = :debug
chef.cookbooks_path = "~/.chef/cookbooks"
chef.roles_path = "~/.chef/roles"
chef.data_bags_path = "~/.chef/databags"
# setup users (from data_bags/users/*.json)
chef.add_recipe "users::sysadmins" # creates users and sysadmin group
chef.add_recipe "users::sysadmin_sudo" # adds %sysadmin group to sudoers
chef.add_recipe "ohai"
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "mysql"
chef.add_recipe "git"
chef.add_recipe "nginx"
chef.add_recipe "redisio::install"
chef.add_recipe "redisio::enable"
chef.add_recipe "java"
chef.add_recipe "ruby_build"
chef.add_recipe "rbenv::vagrant"
chef.add_recipe "rbenv::user"
chef.add_recipe "nodejs::install_from_source"
chef.add_recipe "nodejs::npm"
# custom JSON attributes:
chef.json = {
:mysql_password => "xxx",
:java => {
:oracle => {
"accept_oracle_download_terms" => true
},
:install_flavor => "openjdk",
:jdk_version => "7",
},
:nodejs => {
:version => '0.8.22',
:npm => '1.2.13',
},
:rbenv => {
:user_installs => [{
:user => 'colin',
:rubies => ['jruby-1.7.3', '1.9.3-p392'],
:global => '1.9.3-p392',
:gems => {
'jruby-1.7.3' => [
{:name => 'bundler'},
],
'1.9.3-p392' => [
{:name => 'bundler'},
],
},
}],
},
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment