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
8 changes: 8 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ usually `/etc/saslauthd.conf`.

Default value: `$::sasl::params::saslauthd_ldap_conf_file`

##### `ldap_conf_file_mode`

Data type: `String`

file mode for the ldap_conf_file

Default value: `'0644'`

##### `ldap_auth_method`

Data type: `Optional[Enum['bind', 'custom', 'fastbind']]`
Expand Down
2 changes: 2 additions & 0 deletions manifests/authd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
# @param hasstatus If the service supports querying the running status or not.
# @param ldap_conf_file Path to the configuration file for LDAP configuration,
# usually `/etc/saslauthd.conf`.
# @param ldap_conf_file_mode file mode for the ldap_conf_file
# @param ldap_auth_method How to authenticate with the LDAP server.
# @param ldap_bind_dn Distinguished name used to bind to the LDAP server.
# @param ldap_bind_pw Password used to bind with.
Expand Down Expand Up @@ -82,6 +83,7 @@
Boolean $hasstatus = $::sasl::params::saslauthd_hasstatus,
# ldap
Optional[Stdlib::Absolutepath] $ldap_conf_file = $::sasl::params::saslauthd_ldap_conf_file,
String $ldap_conf_file_mode = '0644',
Optional[Enum['bind', 'custom', 'fastbind']] $ldap_auth_method = undef,
Optional[Bodgitlib::LDAP::DN] $ldap_bind_dn = undef,
Optional[String] $ldap_bind_pw = undef,
Expand Down
3 changes: 2 additions & 1 deletion manifests/authd/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$mechanism = $::sasl::authd::mechanism
$threads = $::sasl::authd::threads
$ldap_conf_file = $::sasl::authd::ldap_conf_file
$ldap_conf_file_mode = $::sasl::authd::ldap_conf_file_mode
$ldap_auth_method = $::sasl::authd::ldap_auth_method
$ldap_bind_dn = $::sasl::authd::ldap_bind_dn
$ldap_bind_pw = $::sasl::authd::ldap_bind_pw
Expand Down Expand Up @@ -100,7 +101,7 @@
ensure => $ldap_conf_file_ensure,
owner => 0,
group => 0,
mode => '0644',
mode => $ldap_conf_file_mode,
content => template('sasl/saslauthd.conf.erb'),
}
}
7 changes: 7 additions & 0 deletions spec/classes/sasl_authd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@

EOS
end
it do
is_expected.to contain_file('/etc/saslauthd.conf').with_mode('0644')
end

case facts[:osfamily]
when 'Debian'
Expand Down Expand Up @@ -173,6 +176,7 @@
let(:params) do
super().merge(
ldap_conf_file: '/tmp/saslauthd.conf',
ldap_conf_file_mode: '0600',
# TODO
)
end
Expand All @@ -186,6 +190,9 @@

EOS
end
it do
is_expected.to contain_file('/tmp/saslauthd.conf').with_mode('0600')
end

case facts[:osfamily]
when 'Debian'
Expand Down