cookbooks/fb_logrotate/templates/default/fb_bsd_newsyslog.conf.erb (24 lines of code) (raw):

# Generated by chef # # See http://www.freebsd.org/cgi/man.cgi?query=newsyslog.conf # If 'when' is '*' (no time), then we can put in the size, but # otherwise, we have a 'when' and must specify '*' for size. <%= sprintf("%s %-33s %-20s %s %s %-8s %s %s %s %s","#","logfilename","[owner:group]", "mode","count","size","when ","flags","[/pid_file]","[sig_num]") %> <% node['fb_logrotate']['configs'].keys.sort.each do |f| %> <% output = Hash[] %> <% data = node['fb_logrotate']['configs'][f].to_hash %> <% node['fb_logrotate']['globals'].keys.sort.each do |p| %> <% output[p] = node['fb_logrotate']['globals'][p] %> <% end %> <% if data['overrides'] -%> <% data['overrides'].keys.sort.each do |k| %> <% output[k] = data['overrides'][k] -%> <% end %> <% end %> <% data['files'].each do |filename| %> <%= sprintf("%-35s %-20s %-4s %-5s %-8s %-5s %-5s %s %s",filename, output['owner_group'],output['mode'],output['rotate'], output['when'] == '*' ? output['size'] : '*',output['when'], output['flags'], output['pid_file'],output['sig_num']) %> <% end %> <% end %>