Skip to content
Snippets Groups Projects
config.erb 1.56 KiB
Newer Older
# Automatically generated by base::newsyslog::config via Puppet
Adam Lewenberg's avatar
Adam Lewenberg committed

set save    = <%= directory %>/OLD/%n
<% if archive != '' then -%>
Adam Lewenberg's avatar
Adam Lewenberg committed
set archive = <%= archive %>/%Y/%M/%d/%m.%n
<% end -%>

<%= name %> {
<% if stop != '' then -%>
    stop: <%= stop %>
Adam Lewenberg's avatar
Adam Lewenberg committed
<% end -%>
<% if restart != '' then -%>
Adam Lewenberg's avatar
Adam Lewenberg committed
    restart: <%= restart %>
<% end -%>
<% if stop != '' || restart != '' then -%>
<% logs.each do |log|                                       -%>
<%   log_name = log.gsub(/[\.\-\<\>]/, '_')                 -%>
<%   path     = directory + '/' + log                       -%>
<%   perms    = [log_owner, log_group, log_mode].join(' ')  -%>
    log: <%= log_name %> <%= path %> <%= perms %>
<% end                                                      -%>

<% logs.each do |log|                                       -%>
<%   log_name = log.gsub(/[\.\-\<\>]/, '_')                 -%>
    archive: <%= log_name %> save <%= save_num %>
<%   if archive != '' then                                  -%>
    archive: <%= log_name %> archive 0
<%   end                                                    -%>
<% end                                                      -%>
<% if analyze != '' then                                    -%>

<%   alogs = analyze_logs.to_a.empty? ? logs : analyze_logs -%>
<%   alogs.each do |log|                                    -%>
<%     log_name = log.gsub(/[\.\-\<\>]/, '_')               -%>
    analyze: <%= log_name %> <%= analyze %>
<%   end                                                    -%>
<% end                                                      -%>
Adam Lewenberg's avatar
Adam Lewenberg committed
}