Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

Commit

Permalink
Added support for log rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
hectcastro committed Apr 14, 2012
1 parent 18f54d7 commit 22b41d7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -11,6 +11,7 @@ Installs and configures StatsD.
## Cookbooks ##

* git
* logrotate
* nodejs

# Attributes #
Expand Down
7 changes: 4 additions & 3 deletions metadata.rb
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions 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"]
Expand Down Expand Up @@ -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 ]
Expand Down

0 comments on commit 22b41d7

Please sign in to comment.