Add logrotate cookbook
This commit is contained in:
23
cookbooks/logrotate/templates/default/logrotate.erb
Normal file
23
cookbooks/logrotate/templates/default/logrotate.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
# This file was generated by Chef for <%= node['fqdn'] %>.
|
||||
# Do not modify this file by hand!
|
||||
|
||||
<%= @path %> {
|
||||
<%- if @frequency %>
|
||||
<%= @frequency %>
|
||||
<%- end %>
|
||||
<%- CookbookLogrotate::VALUES.each do |opt_name| %>
|
||||
<% if instance_variable_get("@#{opt_name}") %>
|
||||
<%= "#{opt_name} #{instance_variable_get("@#{opt_name}")}" %>
|
||||
<%- end %>
|
||||
<%- end %>
|
||||
<% @options.each do |o| -%>
|
||||
<%= o %>
|
||||
<% end -%>
|
||||
<%- CookbookLogrotate::SCRIPTS.each do |script_name| %>
|
||||
<% unless instance_variable_get("@#{script_name}").empty? %>
|
||||
<%= script_name %>
|
||||
<%= instance_variable_get("@#{script_name}") %>
|
||||
endscript
|
||||
<%- end %>
|
||||
<%- end %>
|
||||
}
|
||||
Reference in New Issue
Block a user