recipiez 0.5.15 → 0.5.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Recipiez
2
- VERSION = '0.5.15'
2
+ VERSION = '0.5.16'
3
3
  end
data/recipes/logrotate.rb CHANGED
@@ -11,6 +11,19 @@ Capistrano::Configuration.instance(true).load do
11
11
  put generated, "#{application}"
12
12
  sudo "mv #{application} /etc/logrotate.d/#{application}"
13
13
  end
14
+
15
+ desc "Configure logrotate for high traffic apps on EC2"
16
+ task :configure_ec2_performance, :roles => [:app, :web] do
17
+ _cset :log_directory, 'log'
18
+
19
+ # create the directory and chown in mnt TODO
20
+ sudo "mkdir -p /mnt/archived_logs/#{application}"
21
+ sudo "chown -R #{user}:#{user} /mnt/archived_logs"
22
+ generated = render('logrotate_ec2', binding)
23
+ puts generated
24
+ put generated, "#{application}"
25
+ sudo "mv #{application} /etc/logrotate.d/#{application}"
26
+ end
14
27
  end
15
28
 
16
29
  end
@@ -0,0 +1,19 @@
1
+ <%= current_path %>/<%= log_directory %>/*.log {
2
+ daily
3
+ missingok
4
+ rotate 28
5
+ compress
6
+ nodelaycompress
7
+ notifempty
8
+ copytruncate
9
+ dateext
10
+ sharedscripts
11
+ lastaction
12
+ LOGDATE=$(date +"%H:%M")
13
+ GZREGEX="s/(.*).gz$/\$1-$LOGDATE.gz/"
14
+ rename $GZREGEX *.gz
15
+ mv <%= current_path %>/<%= log_directory %>/*.gz /mnt/archived_logs/<%= application %>/
16
+ endscript
17
+ }
18
+
19
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 15
9
- version: 0.5.15
8
+ - 16
9
+ version: 0.5.16
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alastair Brunton
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2014-01-31 00:00:00 +01:00
17
+ date: 2014-02-05 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,7 @@ files:
57
57
  - recipes/ssl.rb
58
58
  - recipes/templates/apache_monit.erb
59
59
  - recipes/templates/logrotate.erb
60
+ - recipes/templates/logrotate_ec2.erb
60
61
  - recipes/templates/mongo_ini.erb
61
62
  - recipes/templates/monit_config.erb
62
63
  - recipes/templates/mysql_monit.erb