Skip to content

Instantly share code, notes, and snippets.

View danielsdeleo's full-sized avatar

Dan DeLeo danielsdeleo

View GitHub Profile
# from rsyslog::default.rb:
# move this into the provider....
# service "rsyslog" do
# supports :restart => true, :reload => true
# action [:enable, :start]
# end
# from rsyslog/providers/imfile.rb:
# Check to see if there is a entry in /etc/fstab. Last entry for a volume wins.
enabled = false
::File.foreach("/etc/fstab") do |line|
case line
when /^[#\s]/
next
when /^#{device_fstab_regex}\s+#{Regexp.escape(@new_resource.mount_point)}\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/
enabled = true
@current_resource.fstype($1)
@current_resource.options($2)
1) Just getting the install process down....
a) bootstrapping a server is really confusing
- you need to install a bunch of libraries
- you need to install a bunch of gems
- you need to install chef-solo
- you need to tell chef-solo to turn into a chef-server
b) validation.pem
- so basically, you have to realize that this is a temporary key but you kind of have to manually install it on any new machine? No better way to do this?
2) Cookbooks, how do you manage them?
- I had difficulty in understanding that chef server is just a process (or group of them) and then you give it cookbooks to work with
# Author:: Adam Jacob <adam@opscode.com>
# Author:: Joshua Timberman <joshua@opscode.com>
#
# Copyright 2009-2010, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
class Chef
class Provider
class Package
class Rubygems
Chef::Log.info "Patch rubygems provider"
@@GEM_CACHE = {}
@@GEM_CACHE_TIMESTAMP = nil
-module(test_helper).
-export([riak_test/1]).
riak_test(Fun) ->
start_riak(),
{ok, Riak} = riak:local_client(),
Ret = (catch Fun(Riak)),
stop_riak(),
case Ret of
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#
# ec2 ami-1515f67c
sudo sed -i 's/universe/multiverse universe/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert rubygems git-core rake librspec-ruby libxml-ruby thin couchdb zlib1g-dev libxml2-dev
sudo gem sources -a http://gems.opscode.com
sudo gem install cucumber merb-core jeweler uuidtools json libxml-ruby --no-ri --no-rdoc
mkdir ~/src
cd ~/src
git clone git://github.com/opscode/chef.git
git clone git://github.com/opscode/ohai.git
# ec2-run-instances -k <key_name> ami-1515f67c
# Needed to be able to get Java packages later
sudo sed -i 's/universe/multiverse universe/' /etc/apt/sources.list
sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
# Accept the Sun Java license
echo 'sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true' | sudo debconf-set-selections
sudo apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential zlib1g-dev libxml2-dev wget ssl-cert git-core couchdb rabbitmq-server sun-java6-jdk sun-java6-jre
# geoip-c-0.5.5.gem is in cookbooks/geoip/files/default
remote_file "/tmp/geoip-c-0.5.5.gem" do
source 'geoip-c-0.5.5.gem'
end
gem_package "/tmp/geoip-c-0.5.5.gem" do
action :install
end