Add logrotate cookbook

This commit is contained in:
Greg Karékinian
2016-05-13 17:10:03 +02:00
parent 096b4900bd
commit 5d11298c1d
23 changed files with 1308 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
# This file was generated by Chef for <%= node['fqdn'] %>.
# Do not modify this file by hand!
<% @configuration.directives.each do |d| -%>
<%= d %>
<% end -%>
<% @configuration.values.each do |k, v| -%>
<%= k %> <%= v %>
<% end -%>
include /etc/logrotate.d
<% @configuration.paths.each do |path, path_config| -%>
<%= path %> {
<% path_config['directives'].each do |d|-%>
<%= d %>
<% end -%>
<% path_config['values'].each do | k, v | -%>
<%= k %> <%= v %>
<% end -%>
<% path_config['scripts'].each do | scripttype, body | -%>
<%= scripttype %>
<%= body %>
endscript
<% end -%>
}
<% end -%>

View 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 %>
}