Skip to content

Commit 9c6f10b

Browse files
committed
Allow setting the DefaultAuthType
1 parent 7193366 commit 9c6f10b

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

REFERENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ The following parameters are available in the `cups` class:
100100
* [`max_jobs_per_user`](#-cups--max_jobs_per_user)
101101
* [`preserve_job_files`](#-cups--preserve_job_files)
102102
* [`preserve_job_history`](#-cups--preserve_job_history)
103+
* [`default_auth_type`](#-cups--default_auth_type)
103104

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

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

406407
Default value: `undef`
407408

409+
##### <a name="-cups--default_auth_type"></a>`default_auth_type`
410+
411+
Data type: `Enum['Basic', 'Negotiate']`
412+
413+
414+
415+
Default value: `'Basic'`
416+
408417
### <a name="cups--packages"></a>`cups::packages`
409418

410419
Private class

manifests/init.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
Optional[Variant[String, Array[String]]] $browse_local_protocols = undef,
7676
Optional[Boolean] $browse_web_if = undef,
7777
Boolean $browsing = false,
78+
Enum['Basic', 'Negotiate'] $default_auth_type = 'Basic',
7879
Optional[String] $default_queue = undef,
7980
Variant[String, Array[String]] $listen = ['localhost:631', '/var/run/cups/cups.sock'],
8081
Optional[Variant[String, Hash]] $location = undef,

spec/classes/init_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,5 +853,21 @@
853853
it { is_expected.to contain_file('/etc/cups/cupsd.conf').with(content: %r{^WebInterface No$}) }
854854
end
855855
end
856+
857+
describe 'default_auth_type' do
858+
let(:facts) { any_supported_os }
859+
860+
context 'when not set' do
861+
let(:params) { {} }
862+
863+
it { is_expected.to contain_file('/etc/cups/cupsd.conf').with(content: %r{^DefaultAuthType Basic$}) }
864+
end
865+
866+
context 'when set to Negotiate' do
867+
let(:params) { { default_auth_type: 'Negotiate' } }
868+
869+
it { is_expected.to contain_file('/etc/cups/cupsd.conf').with(content: %r{^DefaultAuthType Negotiate$}) }
870+
end
871+
end
856872
end
857873
end

templates/cupsd/_directives.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<%= COMMENT_OUT if @browse_local_protocols.nil? -%>BrowseLocalProtocols <%= @browse_local_protocols.is_a?(Array) ? @browse_local_protocols.join(' ') : @browse_local_protocols %>
55
<%= COMMENT_OUT if @browse_web_if.nil? -%>BrowseWebIF <%= (@browse_web_if ? 'Yes' : 'No') %>
66
<%= COMMENT_OUT if @browsing.nil? -%>Browsing <%= (@browsing ? 'Yes' : 'No') %>
7-
DefaultAuthType Basic
7+
<%= COMMENT_OUT if @default_auth_type.nil? -%>DefaultAuthType <%= @default_auth_type %>
88
<% unless @listen.empty? -%>
99
<% [@listen].flatten.each do |l| -%>
1010
<%= "Listen #{l}" %>

0 commit comments

Comments
 (0)