From c0a9ffc076e5bb3fb25103b0bf390b9dc7e756b1 Mon Sep 17 00:00:00 2001 From: Aaron Hicks Date: Tue, 4 Feb 2014 17:11:27 +1300 Subject: Preserve FQDN parameter --- README.md | 2 ++ manifests/client.pp | 4 +++- templates/client.conf.erb | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e46c0e..b9c2468 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Manage rsyslog client and server via Puppet custom_config => undef, server => 'log', port => '514', + preserve_fqdn => undef, } ``` for read from file @@ -88,6 +89,7 @@ The following lists all the class parameters this module accepts. server_dir STRING Folder where logs will be stored on the server. Defaults to '/srv/log/' custom_config STRING Specify your own template to use for server config. Defaults to undef. Example usage: custom_config => 'rsyslog/my_config.erb' high_precision_timestamps true,false Whether or not to use high precision timestamps. + preserve_fqdn true,false Whether or not to preserve the fully qualified domain name when logging. RSYSLOG::CLIENT CLASS PARAMETERS VALUES DESCRIPTION ------------------------------------------------------------------- diff --git a/manifests/client.pp b/manifests/client.pp index f275ad3..be8518d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -15,6 +15,7 @@ # [*server*] # [*port*] # [*ssl_ca*] +# [*preserve_fqdn] # # === Variables # @@ -32,7 +33,8 @@ class rsyslog::client ( $custom_params = undef, $server = 'log', $port = '514', - $ssl_ca = undef + $ssl_ca = undef, + $preserve_fqdn = undef ) inherits rsyslog { $content_real = $custom_config ? { diff --git a/templates/client.conf.erb b/templates/client.conf.erb index d86a271..696b9b2 100644 --- a/templates/client.conf.erb +++ b/templates/client.conf.erb @@ -41,6 +41,11 @@ auth,authpriv.* /var/log/secure <% end -%> <% end -%> +<% if scope.lookupvar('rsyslog::client::preserve_fqdn') -%> +# Tell rsyslog to use FQDN and not short server names +$PreserveFQDN on +<% end -%> + <% if scope.lookupvar('rsyslog::client::log_local') -%> <% if scope.lookupvar('rsyslog::log_style') == 'debian' -%> # First some standard log files. Log by facility. -- cgit v1.2.3