Skip to content

Instantly share code, notes, and snippets.

@mewdriller
Created May 1, 2012 03:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mewdriller/2564740 to your computer and use it in GitHub Desktop.
Save mewdriller/2564740 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#^syntax detection
site 'http://community.opscode.com/api/v1'
cookbook 'apt'
cookbook 'git',
git: 'https://github.com/fnichol/chef-git.git'
cookbook 'build-essential'
cookbook 'rvm',
git: 'git://github.com/fnichol/chef-rvm.git', ref: 'v0.8.6'
$ git clone <your_git_repository_url>
$ cd <repository_name>
$ librarian-chef install
$ vagrant up
$ gem install librarian
$ echo cookbooks >> .gitignore
$ echo tmp >> .gitignore
$ librarian-chef init
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
$ vagrant init lucid32
$ vagrant up
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "lucid64"
config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
config.vm.network :hostonly, "33.33.33.10"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks"]
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "rvm::vagrant"
chef.add_recipe "rvm::system"
chef.add_recipe "git"
end
end
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
# Enable and configure the chef solo provisioner
config.vm.provision :chef_solo do |chef|
# We're going to download our cookbooks from the web
chef.recipe_url = "http://files.vagrantup.com/getting_started/cookbooks.tar.gz"
# Tell chef what recipe to run. In this case, the `vagrant_main` recipe
# does all the magic.
chef.add_recipe("vagrant_main")
end
end
@drewww
Copy link

drewww commented Jul 5, 2012

It looks to me like the syntax on Cheffiles changed since you first wrote this. I updated the Cheffile in my gist here: https://gist.github.com/3055132

I also moved the git pointers to what seem to be the current canonical homes for each of those packages, except for rvm which seems to still be externally managed. I also added a Cheffile.lock entry to gitignore.

Thanks much for the blog post! Was a huge help with getting this setup for me, and wanted to make sure the lessons I learned got reflected in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment