Skip to content

Instantly share code, notes, and snippets.

bash "build something" do
user "root"
cwd "/var/lib/git/something"
action :nothing
code <<-EOH
make clean || true
./buildconfig.sh || true
./configure --prefix=/usr/local/
./configure
make
git "/var/lib/git/xxx" do
action :sync
repository "git://foo/xxx.git"
revision "master"
depth 1
end
template "/etc/something" do
local true
source "/var/lib/git/xxx/soemthing"
@bakins
bakins / gist:804922
Created January 31, 2011 22:02
brain dead data bags in chef solo
if Chef::Config[:solo]
class Chef
module Mixin
module Language
def data_bag(bag)
@solo_data_bags = {} if @solo_data_bags.nil?
unless @solo_data_bags[bag]
@solo_data_bags[bag] = {}
Dir.glob(File.join(Chef::Config[:data_bag_path], bag,
@bakins
bakins / gist:810046
Created February 3, 2011 19:47
error in search
[Thu, 03 Feb 2011 14:47:07 -0500] INFO: Starting Chef Run (Version 0.9.12)
[Thu, 03 Feb 2011 14:47:08 -0500] INFO: Storing updated cookbooks/lsd/recipes/moxi.rb in the cache.
[Thu, 03 Feb 2011 14:47:11 -0500] INFO: Ran execute[apt-get update] successfully
[Thu, 03 Feb 2011 14:47:11 -0500] INFO: scope:prod AND datacenter:sdc AND roles:membase
[Thu, 03 Feb 2011 14:47:12 -0500] WARN: HTTP Request Returned 500 Internal Server Error: Net::HTTPServerException: 400 "orgapachelucenequeryParserParseException_Cannot_parse_scopeprod_AND_run_listrolelsdweb_Encountered_____at_line_1_column_36_Was_expecting_one_of_____TO______RANGEIN_QUOTED______RANGEIN_GOOP______"
[Thu, 03 Feb 2011 14:47:12 -0500] ERROR: Running exception handlers
[Thu, 03 Feb 2011 14:47:12 -0500] ERROR: Exception handlers complete
/usr/lib/ruby/1.8/net/http.rb:2101:in `error!': 500 "Internal Server Error" (Net::HTTPFatalError)
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest.rb:233:in `api_request'
from /usr/lib/ruby/gems
apt_repository "lua-turner" do
uri "http://#{node[:ubuntu][:turner_repo]}/repos/lua"
distribution node['lsb']['codename']
components ["main"]
key "http://#{node[:ubuntu][:turner_repo]}/repos/lua/turner-lua-repo.key"
action :nothing
end
knife node show lsds1ngx12.turner.com -a scope
{
"scope": "prod"
}
knife search node "scope:prod" -i | grep lsds1ngx12
nothing!
service "nginx" do
supports :status => true, :restart => true, :reload => true
action :enable
end
ruby_block "start nginx service" do
block do
true
end
action :create
/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem json_pure (>= 0) (Gem::LoadError)
from /usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
from /usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/lib/ruby/1.8/merb-core/bootloader.rb:419:in `enable_json_gem'
from /usr/lib/ruby/1.8/merb-core/bootloader.rb:392:in `run'
from /usr/lib/ruby/1.8/merb-core/bootloader.rb:99:in `run'
from config.ru:13
from /var/lib/gems/1.8/gems/rack-1.3.0/lib/rack/builder.rb:51:in `instance_eval'
from /var/lib/gems/1.8/gems/rack-1.3.0/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
~ stack level too deep - (SystemStackError)
/usr/lib/ruby/gems/1.8/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
/usr/lib/ruby/gems/1.8/gems/bunny-0.6.0/lib/bunny.rb:62:in `setup'
/usr/lib/ruby/gems/1.8/gems/bunny-0.6.0/lib/bunny.rb:34:in `new'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/index_queue/amqp_client.rb:43:in `amqp_client'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/index_queue/amqp_client.rb:72:in `queue_for_object'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/index_queue/indexable.rb:95:in `publish_object'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/lib/chef/index_queue/indexable.rb:74:in `add_to_index'
name "COMODO"
version "0.1.0"
dependencies ["openssl"]
certificate = "-----BEGIN CERTIFICATE-----
MIIE/DCCA+SgAwIBAgIQFpDDKbZ4BgdRHwWwNEhGyzANBgkqhkiG9w0BAQUFADBv
MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
eHRlcm5hbCBDQSBSb290MB4XDTEwMDQxNjAwMDAwMFoXDTIwMDUzMDEwNDgzOFow