Skip to content
Browse files

Added support for log rotation.

  • Loading branch information...
1 parent 18f54d7 commit 22b41d72d5d550750ef599d770666ea81d9eeaf3 @hectcastro committed Apr 13, 2012
Showing with 14 additions and 3 deletions.
  1. +1 −0 README.md
  2. +4 −3 metadata.rb
  3. +9 −0 recipes/default.rb
View
1 README.md
@@ -11,6 +11,7 @@ Installs and configures StatsD.
## Cookbooks ##
* git
+* logrotate
* nodejs
# Attributes #
View
7 metadata.rb
@@ -2,11 +2,12 @@
maintainer_email "hectcastro@gmail.com"
license "Apache 2.0"
description "Installs and configures StatsD."
-version "0.0.1"
+version "0.0.2"
recipe "statsd", "Installs and configures StatsD"
-depends "git"
-depends "nodejs"
+%w{ git logrotate nodejs }.each do |d|
+ depends d
+end
%w{ ubuntu }.each do |os|
supports os
View
9 recipes/default.rb
@@ -1,5 +1,6 @@
include_recipe "git"
include_recipe "nodejs"
+include_recipe "logrotate"
git node["statsd"]["dir"] do
repository node["statsd"]["repository"]
@@ -41,6 +42,14 @@
action :create
end
+logrotate_app "statsd" do
+ cookbook "logrotate"
+ path node["statsd"]["log_file"]
+ frequency "daily"
+ rotate 7
+ create "644 root root"
+end
+
service "statsd" do
provider Chef::Provider::Service::Upstart
action [ :enable, :start ]

0 comments on commit 22b41d7

Please sign in to comment.
Something went wrong with that request. Please try again.