X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fsyslog_ng%2Ftemplates%2Fsyslog-ng.conf.erb;h=a6c9a9398558987c312f45b63f7ed99f1929a2e9;hb=cf760168ec022b1fc8edb9c46d85b29a98af8ca6;hp=d2940e1c0f62083ad552fbb14872bafec2ab5ca5;hpb=8c54c329a260972d770be7087bfeb235b978cbf4;p=mirror%2Fdsa-puppet.git diff --git a/modules/syslog_ng/templates/syslog-ng.conf.erb b/modules/syslog_ng/templates/syslog-ng.conf.erb index d2940e1c0..a6c9a9398 100644 --- a/modules/syslog_ng/templates/syslog-ng.conf.erb +++ b/modules/syslog_ng/templates/syslog-ng.conf.erb @@ -1,11 +1,12 @@ -<%- if has_variable?("syslogversion") and @syslogversion.to_s == "3.1" -%> -@version: 3.0 -<%- elsif has_variable?("syslogversion") and @syslogversion.to_s == "3.5" -%> +<%- if has_variable?("syslogversion") and @syslogversion.to_s == "3.5" -%> @version: 3.5 @include "scl.conf" <%- elsif has_variable?("syslogversion") and @syslogversion.to_s == "3.8" -%> @version: 3.8 @include "scl.conf" +<%- elsif has_variable?("syslogversion") and @syslogversion.to_s == "3.19" -%> +@version: 3.19 +@include "scl.conf" <%- else -%> @version: 3.3 @include "scl.conf" @@ -52,11 +53,7 @@ options { #sync(0); # the number of lines fitting in the output queue -<%- if has_variable?("syslogversion") and @syslogversion.to_s == "3.1" -%> - log_fifo_size(2048); -<%- else -%> log_fifo_size(10000); -<%- end -%> # enable or disable directory creation for destination files create_dirs(yes); @@ -110,21 +107,13 @@ options { source s_local { # message generated by Syslog-NG internal(); -<%- if has_variable?("syslogversion") and @syslogversion.to_s == "3.1" -%> - # standard Linux log source (this is the default place for the syslog() - # function to send logs to) - unix-stream("/dev/log"); - # messages from the kernel - file("/proc/kmsg" program_override("kernel: ")); -<%- else -%> system(); -<%- end -%> <%- if has_variable?("haproxy") && @haproxy -%> unix-stream("/var/lib/haproxy/dev/log"); <%- end -%> }; -<%- if (@hostname == "lotti") || (@hostname == "lully") || (@hostname == "loghost-grnet-01") || (@hostname == "loghost-osuosl-01") -%> +<% if @loghosts and @loghosts.include?(@fqdn)-%> source s_network { tcp6(port(5140) max-connections(400) tls( key_file("/etc/exim4/ssl/thishost.key") @@ -133,9 +122,7 @@ source s_network { ) ); }; -<%- end -%> -<%- if (@hostname == "lully") -%> source s_network_fastly { tcp6(port(5141) max-connections(100) tls( key_file("/etc/exim4/ssl/thishost.key") @@ -411,67 +398,31 @@ log { }; <%- end -%> - - <%- if @hostname != "lotti" -%> -destination loghost-lotti { - tcp("lotti.debian.org" port (5140) - tls( key_file("/etc/ssl/private/thishost.key") - cert_file("/etc/ssl/debian/certs/thishost.crt") - ca_dir("/etc/ssl/debian/certs/") - ) - ); -}; - <%- end -%> - <%- if @hostname != "lully" -%> -destination loghost-lully { - tcp("lully.debian.org" port (5140) - tls( key_file("/etc/ssl/private/thishost.key") - cert_file("/etc/ssl/debian/certs/thishost.crt") - ca_dir("/etc/ssl/debian/certs/") - ) - ); -}; - <%- end -%> - <%- if @hostname != "loghost-grnet-01" -%> -destination loghost-loghost-grnet-01 { - tcp("loghost-grnet-01.debian.org" port (5140) +<% if @loghosts -%> + <% @loghosts.each do |loghost| -%> +destination loghost-<%= loghost %> { + tcp("<%= loghost %>" port (5140) tls( key_file("/etc/ssl/private/thishost.key") cert_file("/etc/ssl/debian/certs/thishost.crt") ca_dir("/etc/ssl/debian/certs/") ) ); }; - <%- end -%> - <%- if @hostname != "loghost-osuosl-01" -%> -destination loghost-loghost-osuosl-01 { - tcp("loghost-osuosl-01.debian.org" port (5140) - tls( key_file("/etc/ssl/private/thishost.key") - cert_file("/etc/ssl/debian/certs/thishost.crt") - ca_dir("/etc/ssl/debian/certs/") - ) - ); -}; - <%- end -%> + <% end -%> +<% end -%> log { source(s_local); - <%- if @hostname != "lotti" -%> - destination(loghost-lotti); - <%- end -%> - <%- if @hostname != "lully" -%> - destination(loghost-lully); - <%- end -%> - <%- if @hostname != "loghost-grnet-01" -%> - destination(loghost-loghost-grnet-01); - <%- end -%> - <%- if @hostname != "loghost-osuosl-01" -%> - destination(loghost-loghost-osuosl-01); - <%- end -%> +<% if @loghosts -%> + <% @loghosts.each do |loghost| -%> + <%- if loghost != @fqdn -%> + destination(loghost-<%= loghost %>); + <% end -%> + <% end -%> +<% end -%> }; - - -<%- if (@hostname == "lotti") || (@hostname == "lully") || (@hostname == "loghost-grnet-01") || (@hostname == "loghost-osuosl-01") -%> +<% if @loghosts and @loghosts.include?(@fqdn)-%> ############################################################################### ########## ON LOG HOST ######################################################## ############################################################################### @@ -582,12 +533,12 @@ log { source(s_local); log { source(s_local); source(s_network); filter(f_syslog); destination(df_ALL_syslog); }; -<%- end -%> -<%- if (@hostname == "lully") -%> +## syslog endpoint for fastly services: destination fastly { file("/var/log/fastly.log"); }; log { source(s_network_fastly); destination(fastly); }; -<%- end -%> + +<% end -%>