Skip to content

Instantly share code, notes, and snippets.

@rmqver = ''
ruby_block "get rabbit version" do
block do
@rmqver = %x[dpkg -l rabbitmq-server |grep "^ii" |awk "{print $3}"]
@rmqver.sub!(/-\d*$/,'')
end
end
directory "/usr/lib/rabbitmq/lib/rabbitmq_server-#{@rmqver}/plugins" do
recursive true
ruby_block "get rabbit version" do
block do
rmqver = ''
out = %x[dpkg -l rabbitmq-server] # |grep "^ii" |awk "{print $3}"]
out.split("\n").each do |line|
if line =~ /^ii\s*[\w\-]*\s*([0-9\.]+)-\d*/
rmqver = $1
end
end
file "#{params[:home]}/.ssh/config" do
owner params[:user]
group params[:user]
content <<-EOH
Host github.com
IdentityFile ~/.ssh/github
IdentitiesOnly yes
StrictHostKeyChecking no
EOH
end
# force ohai to run and pick up new languages.java data
ruby_block "reload_ohai" do
block do
o = Ohai::System.new
o.all_plugins
node.automatic_attrs.merge! o.data
end
action :nothing
end
execute "hostname --file /etc/hostname" do
action :nothing
end
file "/etc/hostname" do
content "#{new_hostname}"
notifies :run, "execute[hostname --file /etc/hostname]", :immediately
end
@thommay
thommay / gist:905957
Created April 6, 2011 16:19
Reconnoiter Notes
https://labs.omniti.com/labs/reconnoiter/lists/users/2010-July/000467.html on display maths.
https://labs.omniti.com/labs/reconnoiter/lists/users/2010-October/000543.html on getting esper going.
https://labs.omniti.com/labs/reconnoiter/lists/users/2010-December/000583.html and thread
http://blog.brosting.net/?p=10 general stuff
http://www.control-alt-del.org/2011/10/31/monitoring-with-reconnoiter-part-deux/
http://www.ducea.com/2010/07/13/howto-install-reconnoiter-on-debian-lenny/
#!/usr/bin/env ruby
require 'sinatra'
require "sinatra/reloader" if development?
require 'chef'
require 'rack/flash'
require 'haml'
POSSIBLE = [('a'..'z'),('A'..'Z'),(0..9),'.','/'].inject([]) {|s,r| s+Array(r)}
set :sessions, true
template "/etc/snmp.conf" do
if node.recipes.include? "haproxy"
source "snmp-haproxy.conf.erb"
else
source "snmp.conf.erb"
end
end
define :npm, :user => "node", :home => "/srv/node" do
file File.join(params[:home], ".npmrc") do
content <<-EOH
root = #{params[:home]}/.node_libraries
binroot = #{params[:home]}/bin
manroot = #{params[:home]}/share/man
EOH
owner params[:user]
group params[:user]
end
r = gem_package "right_aws" do
action :nothing
end
r.run_action(:install)
require 'rubygems'
Gem.clear_paths
require 'right_aws'