Browse files

Chef playground

  • Loading branch information...
0 parents commit ac93cdd8184ee37a4aa514a7cdbc05ad2a5b2641 Sam Umbach and Alex Redington committed Dec 9, 2011
Showing with 182 additions and 0 deletions.
  1. +3 −0 .chef/knife.rb
  2. +1 −0 .rvmrc
  3. +1 −0 .vagrant
  4. +11 −0 Gemfile
  5. +94 −0 Gemfile.lock
  6. +42 −0 README.md
  7. +11 −0 Vagrantfile
  8. 0 cookbooks/.gitkeep
  9. +4 −0 roles/rails.rb
  10. +5 −0 script/install_cookbook
  11. +5 −0 script/new_cookbook
  12. 0 site-cookbooks/.gitkeep
  13. +5 −0 solo.rb
3 .chef/knife.rb
@@ -0,0 +1,3 @@
+cookbook_copyright "Relevance"
+cookbook_email "opfor@thinkrelevance.com"
+cookbook_license "none"
1 .rvmrc
@@ -0,0 +1 @@
+rvm use ree-1.8.7@elzar
1 .vagrant
@@ -0,0 +1 @@
+{"active":{"default":"c9c92ff9-3be9-4e21-a3ac-6e4c0f8550d8"}}
11 Gemfile
@@ -0,0 +1,11 @@
+source :rubygems
+
+group "development" do
+ # chef and vagrant require different versions of json, so we have to force the version manually
+ gem "json", "1.5.2"
+
+ gem "vagrant", "0.8.7"
+ gem "chef", "0.10.2"
+ gem "knife-solo", "0.0.4"
+ gem "knife-github-cookbooks", :git => "git://github.com/sumbach/knife-github-cookbooks.git"
+end
94 Gemfile.lock
@@ -0,0 +1,94 @@
+GIT
+ remote: git://github.com/sumbach/knife-github-cookbooks.git
+ revision: 13d5d7444b468cab24e6fa2d4b07da6ea45ac088
+ specs:
+ knife-github-cookbooks (0.1.5)
+ chef (~> 0.10.0)
+ launchy (~> 0.4.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ archive-tar-minitar (0.5.2)
+ bunny (0.7.8)
+ chef (0.10.2)
+ bunny (>= 0.6.0)
+ erubis
+ highline
+ json (>= 1.4.4, <= 1.5.2)
+ mixlib-authentication (>= 1.1.0)
+ mixlib-cli (>= 1.1.0)
+ mixlib-config (>= 1.1.2)
+ mixlib-log (>= 1.3.0)
+ moneta
+ net-ssh (~> 2.1.3)
+ net-ssh-multi (~> 1.0.1)
+ ohai (>= 0.6.0)
+ rest-client (>= 1.0.4, < 1.7.0)
+ treetop (~> 1.4.9)
+ uuidtools
+ configuration (1.3.1)
+ erubis (2.7.0)
+ ffi (1.0.11)
+ highline (1.6.8)
+ i18n (0.6.0)
+ json (1.5.2)
+ knife-solo (0.0.4)
+ chef (~> 0.10.0)
+ net-ssh (~> 2.1.3)
+ launchy (0.4.0)
+ configuration (>= 0.0.5)
+ rake (>= 0.8.1)
+ mime-types (1.17.2)
+ mixlib-authentication (1.1.4)
+ mixlib-log
+ mixlib-cli (1.2.2)
+ mixlib-config (1.1.2)
+ mixlib-log (1.3.0)
+ moneta (0.6.0)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-ssh (2.1.4)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ net-ssh-multi (1.0.1)
+ net-ssh (>= 1.99.2)
+ net-ssh-gateway (>= 0.99.0)
+ ohai (0.6.10)
+ mixlib-cli
+ mixlib-config
+ mixlib-log
+ systemu (~> 2.2.0)
+ yajl-ruby
+ polyglot (0.3.3)
+ rake (0.9.2.2)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ systemu (2.2.0)
+ thor (0.14.6)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ uuidtools (2.1.2)
+ vagrant (0.8.7)
+ archive-tar-minitar (= 0.5.2)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6.0)
+ json (~> 1.5.1)
+ net-scp (~> 1.0.4)
+ net-ssh (~> 2.1.4)
+ thor (~> 0.14.6)
+ virtualbox (~> 0.9.1)
+ virtualbox (0.9.2)
+ ffi (~> 1.0.9)
+ yajl-ruby (1.1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ chef (= 0.10.2)
+ json (= 1.5.2)
+ knife-github-cookbooks!
+ knife-solo (= 0.0.4)
+ vagrant (= 0.8.7)
42 README.md
@@ -0,0 +1,42 @@
+# Getting Started
+
+Download and install VirtualBox (as instructed in the Vagrant
+[Getting Started guide](http://vagrantup.com/docs/getting-started/index.html)). Then set up
+your bundle and grab the Ubuntu Lucid VM image.
+
+ gem install bundler
+ bundle install
+ vagrant box add lucid64 http://files.vagrantup.com/lucid64.box
+
+## Spin up a new VM
+
+ vagrant up
+
+## SSH into the VM
+
+ vagrant ssh
+
+## Destroy the VM
+
+ vagrant destroy
+
+## Re-run Chef recipes on the VM
+
+ vagrant provision
+
+## Stop/Start the VM
+
+ vagrant suspend
+ vagrant resume
+
+# Install additional cookbooks
+
+This script (and the knife extension it invokes) automatically creates a
+vendor branch for tracking upstream git sources, merges the cookbook into the
+cookbooks/ directory, and makes it easy to update these cookbook as needed in
+the future.
+
+To use this script, the cookbook must be in its own git repository, like those
+at https://github.com/cookbooks/.
+
+ ./script/install_cookbook cookbooks/mysql
11 Vagrantfile
@@ -0,0 +1,11 @@
+Vagrant::Config.run do |config|
+ config.vm.box = "lucid64"
+ config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
+ config.vm.host_name = "elzar.thinkrelevance.com"
+ config.vm.network "172.25.5.5"
+ config.vm.provision :chef_solo do |chef|
+ chef.cookbooks_path = ["site-cookbooks", "cookbooks"]
+ chef.roles_path = "roles"
+ chef.add_role("rails")
+ end
+end
0 cookbooks/.gitkeep
No changes.
4 roles/rails.rb
@@ -0,0 +1,4 @@
+name "rails"
+description "rails application and web server"
+run_list(
+)
5 script/install_cookbook
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+PROJECT_DIR=$(dirname "$0")/..
+
+bundle exec knife cookbook github install --config "${PROJECT_DIR}/.chef/knife.rb" --cookbook-path "${PROJECT_DIR}/cookbooks" "$@"
5 script/new_cookbook
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+PROJECT_DIR=$(dirname "$0")/..
+
+bundle exec knife cookbook create --config "${PROJECT_DIR}/.chef/knife.rb" --cookbook-path "${PROJECT_DIR}/site-cookbooks" --readme-format md "$@"
0 site-cookbooks/.gitkeep
No changes.
5 solo.rb
@@ -0,0 +1,5 @@
+file_cache_path "/tmp/chef-solo"
+data_bag_path "/tmp/chef-solo/data_bags"
+cookbook_path [ "/tmp/chef-solo/site-cookbooks",
+ "/tmp/chef-solo/cookbooks" ]
+role_path "/tmp/chef-solo/roles"

0 comments on commit ac93cdd

Please sign in to comment.