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

Commit

Permalink
add LB nginx logrotate config
Browse files Browse the repository at this point in the history
dwradcliffe committed Oct 27, 2014
1 parent 58d9274 commit c4e8c05
Showing 7 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Berksfile.lock
Original file line number Diff line number Diff line change
@@ -207,8 +207,9 @@ GRAPH
rubygems-backups (0.0.19)
chef-vault (>= 0.0.0)
rubygems-ruby (>= 0.0.0)
rubygems-balancer (0.0.36)
rubygems-balancer (0.0.38)
chef-vault (>= 0.0.0)
logrotate (>= 0.0.0)
nginx (>= 0.0.0)
rubygems (>= 0.0.0)
rubygems-bastion (0.0.10)
3 changes: 2 additions & 1 deletion cookbooks/rubygems-balancer/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name 'rubygems-balancer'

version '0.0.36'
version '0.0.38'

depends 'chef-vault'
depends 'logrotate'
depends 'nginx'
depends 'rubygems'
1 change: 1 addition & 0 deletions cookbooks/rubygems-balancer/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
include_recipe 'rubygems-balancer::geoip'
include_recipe 'rubygems-balancer::maintenance'
include_recipe 'rubygems-balancer::site'
include_recipe 'rubygems-balancer::logrotate'

cookbook_file '/etc/default/nginx' do
source 'nginx'
13 changes: 13 additions & 0 deletions cookbooks/rubygems-balancer/recipes/logrotate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Cookbook Name:: rubygems-balancer
# Recipe:: logrotate
#

logrotate_app 'nginx' do
path "#{node['nginx']['log_dir']}/*.log"
frequency 'daily'
rotate 52
options %w(missingok compress delaycompress notifempty sharedscripts)
postrotate " [ -f #{node['nginx']['pid']} ] && kill -USR1 `cat #{node['nginx']['pid']}`"
create '0640 www-data adm'
end
2 changes: 1 addition & 1 deletion environments/common.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"rubygems-app": "= 0.0.31",
"rubygems-apt": "= 0.0.15",
"rubygems-backups": "= 0.0.19",
"rubygems-balancer": "= 0.0.36",
"rubygems-balancer": "= 0.0.38",
"rubygems-bastion": "= 0.0.10",
"rubygems-cache": "= 0.0.3",
"rubygems-chef": "= 0.0.32",
2 changes: 1 addition & 1 deletion environments/production.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"rubygems-app": "= 0.0.31",
"rubygems-apt": "= 0.0.15",
"rubygems-backups": "= 0.0.19",
"rubygems-balancer": "= 0.0.36",
"rubygems-balancer": "= 0.0.38",
"rubygems-bastion": "= 0.0.10",
"rubygems-cache": "= 0.0.3",
"rubygems-chef": "= 0.0.32",
2 changes: 1 addition & 1 deletion environments/staging.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"rubygems-app": "= 0.0.31",
"rubygems-apt": "= 0.0.15",
"rubygems-backups": "= 0.0.19",
"rubygems-balancer": "= 0.0.36",
"rubygems-balancer": "= 0.0.38",
"rubygems-bastion": "= 0.0.10",
"rubygems-cache": "= 0.0.3",
"rubygems-chef": "= 0.0.32",

0 comments on commit c4e8c05

Please sign in to comment.