Skip to content

Instantly share code, notes, and snippets.

define :localgem, :version => nil do
script "install_#{params[:name]}_local_#{params[:version]}" do
interpreter "bash"
user "root"
code <<-EOH
export GEM_HOME=/srv/localgems
export GEM_PATH=/srv/localgems
export PATH="/srv/localgems/bin:$PATH"
gem install #{params[:name]} #{params[:version].nil? ? '' : "--version #{params[:version]}" } --no-rdoc --no-ri
EOH
define :localgem, :version => nil do
script "install_#{params[:name]}_local_#{params[:version]}" do
interpreter "bash"
user "root"
code <<-EOH
export GEM_HOME=/srv/localgems
export GEM_PATH=/srv/localgems
export PATH="/srv/localgems/bin:$PATH"
gem install #{params[:name]} #{params[:version].nil? ? '' : "--version #{params[:version]}" } --no-rdoc --no-ri
EOH
service "slapd" do
supports :restart => true, :status => true
action [ :enable, :start ]
end
# ... some shit ...
service "slapd" do
action :stop
end
(template "/etc/chef/client.rb"
:source "client.rb.erb"
:owner "root")
require 'rubygems'
require 'merb-core'
require 'chef'
require 'rack/etag'
Chef::Config.from_file(File.join("/etc", "chef", "server.rb"))
Merb::Config.setup(:merb_root => File.expand_path(File.dirname(__FILE__)),
:environment => 'production',
:fork_for_class_load => false,
set[:scaffold] = {
"hostname" => "gstmatch-prodstor-01",
"fqdn" => "las1.colo.ignops.com",
"ip_address" => "10.93.56.49",
"net_device" => "eth0",
"netmask" => "255.255.254.0",
"gateway" => "10.93.56.1",
"datacenter" => "las1",
"farm" => {
"name" => "gstmatch",
#!/usr/bin/ruby
#
# Author:: Adam Jacob (<[email protected]>)
# Copyright:: Copyright (c) 2010 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# 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
#
# Chef
file "/tmp/foo" do
owner "root"
mode "0755"
end
# Puppet
file { "/tmp/foo":
owner => "root",
mode => "0755",
#!/bin/sh
#
# Author:: Adam Jacob (<[email protected]>)
# Copyright:: Copyright (c) 2010 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# 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
#
#!/usr/bin/ruby
#
# Author:: Adam Jacob (<[email protected]>)
# Copyright:: Copyright (c) 2010 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# 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
#