Skip to content

Instantly share code, notes, and snippets.

@schisamo
Created February 20, 2013 15:35
Show Gist options
  • Save schisamo/46eafba27d43c4a1e026 to your computer and use it in GitHub Desktop.
Save schisamo/46eafba27d43c4a1e026 to your computer and use it in GitHub Desktop.
name "opscode-hubot"
maintainer "Seth Chisamore"
maintainer_email "schisamo@opscode.com"
license "All rights reserved"
description "Installs/Configures opscode-hubot"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.1"
depends "hubot", "~> 1.0.1"
depends "rsyslog"
#
# Cookbook Name:: opscode-hubot
# Recipe:: default
#
# Copyright (c) 2013, Opscode, Inc.
#
node.set['hubot']['version'] = "2.4.6"
node.set['hubot']['scripts_version'] = "2.4.1"
node.set['hubot']['install_dir'] = "/srv/hubot"
node.set['hubot']['adapter'] = "hipchat"
node.set['hubot']['dependencies'] = {
"hubot-hipchat" => ">= 2.4.5",
"node-stringprep" => "0.1.5"
}
node.set_unless['opscode-hubot']['hipchat_rooms'] = %w{
7557_some_room@conf.hipchat.com
7557_some_other_room@conf.hipchat.com
}
node.set['hubot']['hubot_scripts'] = %w{
ackbar.coffee
applause.coffee
ascii.coffee
b6n.coffee
base64.coffee
beerme.coffee
botsnack.coffee
cheer.coffee
cowsay.coffee
dnsimple.coffee
gemwhois.coffee
github-status.coffee
good-night.coffee
goooood.coffee
horse.coffee
haters.coffee
kittens.coffee
likeaboss.coffee
look-of-disapproval.coffee
nice.coffee
pinkman.coffee
polite.coffee
quote.coffee
rageface.coffee
rimshot.coffee
rubygems.coffee
shipit.coffee
shorten.coffee
spin.coffee
sudo.coffee
sweetdude.coffee
tweet.coffee
walmart.coffee
wat.coffee
wunderground.coffee
xkcd.coffee
yoda-quotes.coffee
yuno.coffee
}
node.set['hubot']['config'] = {
"HUBOT_HIPCHAT_JID" => node['opscode-hubot']['hipchat_jid'],
"HUBOT_HIPCHAT_PASSWORD" => node['opscode-hubot']['hipchat_password'],
"HUBOT_HIPCHAT_ROOMS" => node['opscode-hubot']['hipchat_rooms'].join(","),
"HUBOT_HIPCHAT_DEBUG" => "false"
}
# OS packages required by assorted Hubot scripts
%w{ libexpat1 libexpat1-dev libicu-dev }.each do |pkg|
package pkg do
action :install
end
end
include_recipe "hubot"
# Opscode custom Hubot scripts
remote_directory "#{node['hubot']['install_dir']}/scripts" do
source "scripts"
files_backup 0
files_owner node['hubot']['user']
files_group node['hubot']['group']
files_mode 00644
owner node['hubot']['user']
group node['hubot']['group']
overwrite true
mode 00755
notifies :restart, "service[hubot]", :delayed
end
### LOG HANDLING ###
include_recipe "rsyslog"
template '/etc/rsyslog.d/30-hubot.conf' do
source 'rsyslog.conf.erb'
owner 'root'
group 'root'
mode '644'
notifies :restart, 'service[rsyslog]'
end
template '/etc/logrotate.d/hubot' do
source 'logrotate.erb'
owner 'root'
group 'root'
mode '644'
end
@martinb3
Copy link

martinb3 commented Sep 3, 2014

@schisamo Any chance you would be willing to share your logrotate and rsyslog templates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment