Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
reorganize rubygems-sensu recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
dwradcliffe committed Sep 27, 2014
1 parent 1f76b2f commit 1015b27
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Berksfile.lock
Expand Up @@ -280,7 +280,7 @@ GRAPH
nginx (>= 0.0.0)
rubygems (>= 0.0.0)
rubygems-ruby (0.0.3)
rubygems-sensu (0.0.98)
rubygems-sensu (0.0.99)
build-essential (>= 0.0.0)
chef-vault (>= 0.0.0)
cpan (>= 0.0.0)
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/rubygems-sensu/metadata.rb
@@ -1,7 +1,7 @@
name 'rubygems-sensu'
maintainer 'RubyGems.org ops team'

version '0.0.98'
version '0.0.99'

depends 'build-essential'
depends 'chef-vault'
Expand Down
17 changes: 0 additions & 17 deletions cookbooks/rubygems-sensu/recipes/base.rb
Expand Up @@ -3,23 +3,6 @@
# Recipe:: base
#

gem_package 'sensu-plugin' do
gem_binary '/opt/sensu/embedded/bin/gem'
end

package 'nagios-plugins'

%w( check-procs.rb check_postgres.pl check_memcached.pl ).each do |plugin|
cookbook_file "/etc/sensu/plugins/#{plugin}" do
source plugin
path "/etc/sensu/plugins/#{plugin}"
owner 'sensu'
group 'sensu'
mode '0755'
action :create
end
end

sensu_check 'check_procs' do
command '/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb'
handlers ['slack', 'pagerduty']
Expand Down
19 changes: 0 additions & 19 deletions cookbooks/rubygems-sensu/recipes/cache.rb
Expand Up @@ -3,25 +3,6 @@
# Recipe:: cache
#

include_recipe 'build-essential'
include_recipe 'cpan'

cpan_client 'Cache::Memcached' do
user 'root'
group 'root'
force true
install_type 'cpan_module'
action 'install'
end

cpan_client 'String::CRC32' do
user 'root'
group 'root'
force true
install_type 'cpan_module'
action 'install'
end

sensu_check 'check_memcached_proc' do
command "/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb -p 'memcached -v'"
handlers ['slack', 'pagerduty']
Expand Down
42 changes: 36 additions & 6 deletions cookbooks/rubygems-sensu/recipes/default.rb
Expand Up @@ -28,10 +28,40 @@
additional(environment: node.chef_environment)
end

include_recipe 'rubygems-sensu::app'
include_recipe 'rubygems-sensu::balancer'
include_recipe 'rubygems-sensu::base'
include_recipe 'rubygems-sensu::cache'
include_recipe 'rubygems-sensu::database'
include_recipe 'rubygems-sensu::nginx'
gem_package 'sensu-plugin' do
gem_binary '/opt/sensu/embedded/bin/gem'
end

package 'nagios-plugins'

%w( check-procs.rb check_postgres.pl check_memcached.pl ).each do |plugin|
cookbook_file "/etc/sensu/plugins/#{plugin}" do
source plugin
path "/etc/sensu/plugins/#{plugin}"
owner 'sensu'
group 'sensu'
mode '0755'
action :create
end
end

include_recipe 'build-essential'
include_recipe 'cpan'

cpan_client 'Cache::Memcached' do
user 'root'
group 'root'
force true
install_type 'cpan_module'
action 'install'
end

cpan_client 'String::CRC32' do
user 'root'
group 'root'
force true
install_type 'cpan_module'
action 'install'
end

include_recipe 'sensu::client_service'
7 changes: 7 additions & 0 deletions cookbooks/rubygems-sensu/recipes/server.rb
Expand Up @@ -33,3 +33,10 @@
include_recipe 'sensu::server_service'
include_recipe 'sensu::api_service'
include_recipe 'sensu::dashboard_service'

include_recipe 'rubygems-sensu::app'
include_recipe 'rubygems-sensu::balancer'
include_recipe 'rubygems-sensu::base'
include_recipe 'rubygems-sensu::cache'
include_recipe 'rubygems-sensu::database'
include_recipe 'rubygems-sensu::nginx'
2 changes: 1 addition & 1 deletion environments/common.json
Expand Up @@ -25,7 +25,7 @@
"rubygems-people": "= 0.0.29",
"rubygems-redis": "= 0.0.5",
"rubygems-repo": "= 0.0.26",
"rubygems-sensu": "= 0.0.98",
"rubygems-sensu": "= 0.0.99",
"rubygems-ssh": "= 0.0.5",
"rubygems-utility": "= 0.0.7"
},
Expand Down
2 changes: 1 addition & 1 deletion environments/production.json
Expand Up @@ -25,7 +25,7 @@
"rubygems-people": "= 0.0.29",
"rubygems-redis": "= 0.0.5",
"rubygems-repo": "= 0.0.26",
"rubygems-sensu": "= 0.0.98",
"rubygems-sensu": "= 0.0.99",
"rubygems-ssh": "= 0.0.5",
"rubygems-utility": "= 0.0.7"
},
Expand Down
2 changes: 1 addition & 1 deletion environments/staging.json
Expand Up @@ -25,7 +25,7 @@
"rubygems-people": "= 0.0.29",
"rubygems-redis": "= 0.0.5",
"rubygems-repo": "= 0.0.26",
"rubygems-sensu": "= 0.0.98",
"rubygems-sensu": "= 0.0.99",
"rubygems-ssh": "= 0.0.5",
"rubygems-utility": "= 0.0.7"
},
Expand Down

0 comments on commit 1015b27

Please sign in to comment.