diff --git a/.github/README.md b/.github/README.md index b2f0e328..43646265 100644 --- a/.github/README.md +++ b/.github/README.md @@ -517,6 +517,12 @@ Installs, configures, and manages the CUPS service. } ``` +* `log_debug_level`: Sets the `LogDebugLevel` directive of the CUPS server. + +* `log_level`: Sets the `LogLevel` directive of the CUPS server. + +* `log_time_format`: Sets the `LogTimeFormat` directive of the CUPS server. + * `max_clients`: Specifies the maximum number of simultaneous clients to support. * `max_clients_per_host`: Specifies the maximum number of simultaneous clients to support from a single address. diff --git a/README.md.erb b/README.md.erb index 3d7c1d90..525199c1 100644 --- a/README.md.erb +++ b/README.md.erb @@ -519,6 +519,12 @@ Installs, configures, and manages the CUPS service. } ``` +* `log_debug_level`: Sets the `LogDebugLevel` directive of the CUPS server. + +* `log_level`: Sets the `LogLevel` directive of the CUPS server. + +* `log_time_format`: Sets the `LogTimeFormat` directive of the CUPS server. + * `max_clients`: Specifies the maximum number of simultaneous clients to support. * `max_clients_per_host`: Specifies the maximum number of simultaneous clients to support from a single address. diff --git a/manifests/init.pp b/manifests/init.pp index 580cd4d3..127732bc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -37,6 +37,9 @@ # Note that the `cupsd.conf` directive `Port 631` is equivalent to `Listen *:631`. # *Warning*: For this module to work, it is *mandatory* that CUPS is listening on `localhost:631`. # @param location Sets the access control lists for the CUPS web interface. Restricts access to localhost by default. +# @param log_debug_level Sets the `LogDebugLevel` directive of the CUPS server. +# @param log_level Sets the `LogLevel` directive of the CUPS server. +# @param log_time_format Sets the `LogTimeFormat` directive of the CUPS server. # @param max_clients Specifies the maximum number of simultaneous clients to support. # @param max_clients_per_host Specifies the maximum number of simultaneous clients to support from a single address. # @param max_log_size Sets the `MaxLogSize` directive of the CUPS server. @@ -67,6 +70,9 @@ Optional[String] $default_queue = undef, Variant[String, Array[String]] $listen = ['localhost:631', '/var/run/cups/cups.sock'], Optional[Variant[String, Hash]] $location = undef, + Optional[Integer] $log_debug_level = undef, + Optional[String] $log_level = undef, + Optional[String] $log_time_format = undef, Optional[Integer] $max_clients = undef, Optional[Integer] $max_clients_per_host = undef, Optional[Variant[Integer, String]] $max_log_size = undef, diff --git a/templates/cupsd/_directives.erb b/templates/cupsd/_directives.erb index fa7482e5..8ef7a170 100644 --- a/templates/cupsd/_directives.erb +++ b/templates/cupsd/_directives.erb @@ -10,7 +10,9 @@ DefaultAuthType Basic <%= "Listen #{l}" %> <% end -%> <% end -%> -LogLevel warn +<%= COMMENT_OUT if @log_debug_level.nil? -%>LogDebugLevel <%= @log_debug_level %> +<%= COMMENT_OUT if @log_level.nil? -%>LogLevel <%= @log_level %> +<%= COMMENT_OUT if @log_time_format.nil? -%>LogTimeFormat <%= @log_time_format %> <%= COMMENT_OUT if @max_clients.nil? -%>MaxClients <%= @max_clients %> <%= COMMENT_OUT if @max_clients_per_host.nil? -%>MaxClientsPerHost <%= @max_clients_per_host %> <%= COMMENT_OUT if @max_log_size.nil? -%>MaxLogSize <%= @max_log_size %>