Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow setting TMPREAPER_TIME explicitly through attributes #1

Merged
merged 2 commits into from
Mar 20, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Attributes
* `default['tmpreaper']['dirs']` - directory or directories to clean
* `default['tmpreaper']['delay']` - maximum delay before starting processing
* `default['tmpreaper']['additional_options']` - additional options for tmpreaper
* `default['tmpreaper']['tmptime']` - how old are files to delete (e.g.`1d`)

## cron
* `default['tmpreaper']['cron']['hour']` = hour to run the cron task
Expand Down
6 changes: 5 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
license "All rights reserved"
description "Installs/Configures tmpreaper"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.2"
version "0.1.3"

recipe "tmpreaper", "Main tmpreaper configuration"
recipe "tmpreaper::schedule", "Adds cron job for tmpreaper"
Expand Down Expand Up @@ -38,6 +38,10 @@
:display_name => "Additional Options",
:default => ""

attribute "tmptime",
:display_name => "How old files to clean",
:default => nil

attribute "cron[hour]",
:display_name => "Cron Time (hour)",
:description => "Hour to run the cron job",
Expand Down
3 changes: 2 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
:protect_extra => node['tmpreaper']['protect_extra'],
:dirs => [node['tmpreaper']['dirs']].flatten.join(' '),
:delay => node['tmpreaper']['delay'],
:additional_options => node['tmpreaper']['additional_options']
:additional_options => node['tmpreaper']['additional_options'],
:tmptime => node['tmpreaper']['tmptime']
)
end
4 changes: 3 additions & 1 deletion templates/default/tmpreaper.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ TMPREAPER_PROTECT_EXTRA='<%= @protect_extra %>'
TMPREAPER_DIRS='<%= @dirs %>'
TMPREAPER_DELAY='<%= @delay %>'
TMPREAPER_ADDITIONALOPTIONS='<%= @additional_options %>'

<% if @tmptime %>
TMPREAPER_TIME='<%= @tmptime %>'
<% end %>