Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Allow MaxJobsPerPrinter to be configured #378

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ Installs, configures, and manages the CUPS service.

* `max_request_size`: Specifies the maximum request/file size in bytes.

* `max_jobs_per_printer`: Specifies the maximum jobs per printer.

* `package_ensure`: Whether CUPS packages should be `present` or `absent`. Defaults to `present`.

* `package_manage`: Whether to manage package installation at all. Defaults to `true`.
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
Optional[Integer] $max_clients_per_host = undef,
Optional[Variant[Integer, String]] $max_log_size = undef,
Optional[Integer] $max_request_size = undef,
Optional[Integer] $max_jobs_per_printer = undef,
String $package_ensure = 'present',
Boolean $package_manage = true,
Variant[String, Array[String]] $package_names = $::cups::params::package_names,
Expand Down
14 changes: 14 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,20 @@
end
end

describe 'max_jobs_per_printer' do
let(:facts) { any_supported_os }

context 'when not set' do
it { is_expected.to_not contain_file('/etc/cups/cupsd.conf').with(content: /^MaxJobsPerPrinter/) }
end

context 'when set to 100' do
let(:params) { { max_jobs_per_printer: 100 } }

it { is_expected.to contain_file('/etc/cups/cupsd.conf').with(content: /^MaxJobsPerPrinter 100$/) }
end
end

describe 'package_manage' do
context 'when set to true' do
context 'with default package_names' do
Expand Down
1 change: 1 addition & 0 deletions templates/cupsd/_directives.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DefaultAuthType Basic
<%= COMMENT_OUT if @max_clients_per_host.nil? -%>MaxClientsPerHost <%= @max_clients_per_host %>
<%= COMMENT_OUT if @max_log_size.nil? -%>MaxLogSize <%= @max_log_size %>
<%= COMMENT_OUT if @max_request_size.nil? -%>MaxRequestSize <%= @max_request_size %>
<%= COMMENT_OUT if @max_jobs_per_printer.nil? -%>MaxJobsPerPrinter <%= @max_jobs_per_printer %>
<%= COMMENT_OUT if @page_log_format.nil? -%>PageLogFormat "<%= @page_log_format %>"
<%= COMMENT_OUT if @server_alias.nil? -%>ServerAlias <%= @server_alias.is_a?(Array) ? @server_alias.join(' ') : @server_alias %>
<%= COMMENT_OUT if @server_name.nil? -%>ServerName <%= @server_name %>
Expand Down