Skip to content

Commit 66a7944

Browse files
committed
Add domain parameter and deliver idmapd.conf. Ensure /etc/pam_ldap.conf, /etc/openldap/ldap.conf and /etc/ldap.conf all have the same content as different tools look for them in different places.
1 parent 65686fc commit 66a7944

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

manifests/config.pp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class pamldap::config (
22
$base_dn,
33
$uris,
4+
$domain,
45
) {
56
$uris_space = join($uris, ' ')
67
$uris_comma = join($uris, ',')
@@ -23,18 +24,31 @@
2324
require => Class['pamldap::install'],
2425
notify => Class['pamldap::service'],
2526
}
26-
file { [ '/etc/ldap.conf', '/etc/openldap/ldap.conf' ]:
27+
file { '/etc/ldap.conf':
2728
ensure => present,
2829
mode => '0444',
2930
content => template('pamldap/ldap.conf.erb'),
3031
require => Class['pamldap::install'],
3132
notify => Class['pamldap::service'],
3233
}
34+
file { [ '/etc/pam_ldap.conf', '/etc/openldap/ldap.conf' ]:
35+
ensure => link,
36+
target => '/etc/ldap.conf',
37+
require => File['/etc/ldap.conf'],
38+
notify => Class['pamldap::service'],
39+
}
3340
file { '/etc/sssd/sssd.conf':
3441
ensure => present,
3542
mode => '0600',
3643
content => template('pamldap/sssd.conf.erb'),
3744
require => Class['pamldap::install'],
3845
notify => Class['pamldap::service'],
3946
}
47+
file { '/etc/idmapd.conf':
48+
ensure => present,
49+
mode => '0644',
50+
content => template('pamldap/idmapd.conf.erb'),
51+
require => Class['pamldap::install'],
52+
notify => Class['pamldap::service'],
53+
}
4054
}

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
class pamldap (
22
$base_dn = hiera('pamldap::base_dn'),
3+
$domain = hiera('pamldap::domain'),
34
$uris = hiera('pamldap::uris'),
45
) {
56
class { 'pamldap::config':
67
base_dn => $base_dn,
8+
domain => $domain,
79
uris => $uris,
810
}
911
include pamldap::install

templates/idmapd.conf.erb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Managed by Puppet
2+
[General]
3+
Domain = <%= @domain %>
4+
5+
[Mapping]
6+
Nobody-User = nobody
7+
Nobody-Group = nobody
8+
9+
[Translation]
10+
Method = nsswitch
11+
12+
[Static]
13+

0 commit comments

Comments
 (0)