Skip to content
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
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ The following parameters are available in the `cups` class:
* [`max_jobs_per_user`](#-cups--max_jobs_per_user)
* [`preserve_job_files`](#-cups--preserve_job_files)
* [`preserve_job_history`](#-cups--preserve_job_history)
* [`default_auth_type`](#-cups--default_auth_type)

##### <a name="-cups--access_log_level"></a>`access_log_level`

Expand Down Expand Up @@ -405,6 +406,14 @@ Specifies whether the job history is preserved after a job is printed.

Default value: `undef`

##### <a name="-cups--default_auth_type"></a>`default_auth_type`

Data type: `Enum['Basic', 'Negotiate']`



Default value: `'Basic'`

### <a name="cups--packages"></a>`cups::packages`

Private class
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
Optional[Variant[String, Array[String]]] $browse_local_protocols = undef,
Optional[Boolean] $browse_web_if = undef,
Boolean $browsing = false,
Enum['Basic', 'Negotiate'] $default_auth_type = 'Basic',
Optional[String] $default_queue = undef,
Variant[String, Array[String]] $listen = ['localhost:631', '/var/run/cups/cups.sock'],
Optional[Variant[String, Hash]] $location = undef,
Expand Down
16 changes: 16 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -853,5 +853,21 @@
it { is_expected.to contain_file('/etc/cups/cupsd.conf').with(content: %r{^WebInterface No$}) }
end
end

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

context 'when not set' do
let(:params) { {} }

it { is_expected.to contain_file('/etc/cups/cupsd.conf').with(content: %r{^DefaultAuthType Basic$}) }
end

context 'when set to Negotiate' do
let(:params) { { default_auth_type: 'Negotiate' } }

it { is_expected.to contain_file('/etc/cups/cupsd.conf').with(content: %r{^DefaultAuthType Negotiate$}) }
end
end
end
end
2 changes: 1 addition & 1 deletion templates/cupsd/_directives.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= COMMENT_OUT if @browse_local_protocols.nil? -%>BrowseLocalProtocols <%= @browse_local_protocols.is_a?(Array) ? @browse_local_protocols.join(' ') : @browse_local_protocols %>
<%= COMMENT_OUT if @browse_web_if.nil? -%>BrowseWebIF <%= (@browse_web_if ? 'Yes' : 'No') %>
<%= COMMENT_OUT if @browsing.nil? -%>Browsing <%= (@browsing ? 'Yes' : 'No') %>
DefaultAuthType Basic
<%= COMMENT_OUT if @default_auth_type.nil? -%>DefaultAuthType <%= @default_auth_type %>
<% unless @listen.empty? -%>
<% [@listen].flatten.each do |l| -%>
<%= "Listen #{l}" %>
Expand Down
Loading