]> gitweb.fluxo.info Git - puppet-dhcp.git/commitdiff
Allow the log facility to be configured
authorTomas Doran <tdoran@yelp.com>
Fri, 23 Jan 2015 16:55:12 +0000 (16:55 +0000)
committerTomas Doran <tdoran@yelp.com>
Fri, 23 Jan 2015 16:56:27 +0000 (16:56 +0000)
manifests/init.pp
manifests/server.pp
templates/dhcpd.conf.debian.erb

index 9af496ff9bbfed4ec8a4d99ddd845773a97d6211..fe9219bcd009ae05e7e1b1d25ed4ea496837042b 100644 (file)
@@ -8,6 +8,7 @@
 #                              (default: true)
 #   ['server_ddns_update']   - Set ddns_update on dhcp::server
 #   ['server_authoritative'] - Set authoritative on dhcp::server
+#   ['server_log_facility']  - Set log level on dhcp::server
 #   ['server_opts']          - Set opts for dhcp::server
 #
 # Actions:
@@ -24,12 +25,14 @@ class dhcp (
   $server = true,
   $server_ddns_update = undef,
   $server_authoritative = undef,
+  $server_log_facility = undef,
   $server_opts = undef,
 ) {
   if $server {
     class { '::dhcp::server':
       ddns_update   => $server_ddns_update,
       authoritative => $server_authoritative,
+      log_facility  => $server_log_facility,
       opts          => $server_opts,
     }
   }
index a44cfe1679d967f1561b5aee8e90988ffcc3da35..d4bbc309b626c3d21dfbde759b4ef10ae804415b 100644 (file)
@@ -6,6 +6,8 @@
 #   ['ddns_update']   : ddns-update-style option (defaults to 'none')
 #   ['authoritative'] : a boolean setting whether the DHCP server is
 #                       authoritative (defaults to false)
+#   ['log_facility']  : string containing syslog log levels
+#                       (defaults to local7)
 #   ['opts']          : an array of DHCPD valid options
 #
 # Sample usage:
@@ -36,6 +38,7 @@
 class dhcp::server (
   $ddns_update = 'none',
   $authoritative = false,
+  $log_facility = 'local7',
   $opts = [],
 ) {
   class { '::dhcp::server::packages': } ->
index 7dfd168a69094131fc7ff40f4f1aac52691a9747..e2f31e36810016fafbf2480d055aa53327ef0684 100644 (file)
@@ -16,5 +16,5 @@ ddns-update-style <%= @ddns_update %>;
 
 # Use this to send dhcp log messages to a different log file (you also
 # have to hack syslog.conf to complete the redirection).
-log-facility local7;
+log-facility <%= @log_facility %>;