Skip to content

Commit f7eeb7d

Browse files
committed
Initial version based on documentation from Neil McBennett. All errors are mine though :-)
1 parent 8c54731 commit f7eeb7d

File tree

16 files changed

+184
-3
lines changed

16 files changed

+184
-3
lines changed

.fixtures.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fixtures:
2+
symlinks:
3+
jboss: "#{source_dir}"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pkg/
2+
metadata.json
3+
*.swp

Modulefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name 'erwbgy-pamldap'
2+
version '0.1.0'
3+
source 'https://github.com/erwbgy/puppet-pamldap.git'
4+
author 'erwbgy'
5+
license 'Apache License, Version 2.0'
6+
summary 'Use LDAP for user login/authentication/authorisation/name resolution'
7+
description 'Use LDAP for user login/authentication/authorisation/name resolution'
8+
project_page 'git.com:erwbgy/puppet-pamldap.git'

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# puppet-pamldap
22

3-
Puppet module to use LDAP for user login/authentication/authorisation and related name resolution
3+
Puppet module to use LDAP for user login/authentication/authorisation and
4+
related name resolution
45

56
## Credits
67

7-
This is based on detailed documentation and setup by my colleague Neil McBennett.
8-
He did all the hard work, I just puppetised it.
8+
This is based on detailed documentation and setup by my colleague Neil
9+
McBennett. He did all the hard work, I just puppetised it.

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'rubygems'
2+
require 'puppetlabs_spec_helper/rake_tasks'

example.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pamldap:
2+
base_dn: 'dc=sportingbet,dc=com'
3+
uris: [ 'ldap://10.7.96.13', 'ldap://10.7.96.14' ]
4+

manifests/config.pp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
class pamldap::config (
2+
$base_dn,
3+
$uris,
4+
) {
5+
$uris_space = join($uris, ' ')
6+
$uris_comma = join($uris, ',')
7+
# defaults
8+
File {
9+
owner => 'root',
10+
group => 'root',
11+
}
12+
file { '/etc/pam.d/system-auth':
13+
ensure => present,
14+
mode => '0444',
15+
content => template('pamldap/system-auth.erb'),
16+
require => Class['pamldap::install'],
17+
notify => Class['pamldap::service'],
18+
}
19+
file { '/etc/nsswitch.conf':
20+
ensure => present,
21+
mode => '0444',
22+
content => template('pamldap/nsswitch.conf.erb'),
23+
require => Class['pamldap::install'],
24+
notify => Class['pamldap::service'],
25+
}
26+
file { [ '/etc/ldap.conf', '/etc/openldap/ldap.conf' ]:
27+
ensure => present,
28+
mode => '0444',
29+
content => template('pamldap/ldap.conf.erb'),
30+
require => Class['pamldap::install'],
31+
notify => Class['pamldap::service'],
32+
}
33+
file { '/etc/sssd/sssd.conf':
34+
ensure => present,
35+
mode => '0444',
36+
content => template('pamldap/sssd.conf.erb'),
37+
require => Class['pamldap::install'],
38+
notify => Class['pamldap::service'],
39+
}
40+
}

manifests/init.pp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class pamldap (
2+
$base_dn,
3+
$uris,
4+
) {
5+
class { 'pamldap::config':
6+
base_dn => $base_dn,
7+
uris => $uris,
8+
}
9+
include pamldap::install
10+
include pamldap::service
11+
}

manifests/install.pp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class pamldap::install {
2+
if ! defined(Package['sssd']) {
3+
package { 'sssd': ensure => installed }
4+
}
5+
if ! defined(Package['sssd-client']) {
6+
package { 'sssd-client': ensure => installed }
7+
}
8+
if ! defined(Package['openldap-clients']) {
9+
package { 'openldap-clients': ensure => installed }
10+
}
11+
}

manifests/service.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class pamldap::service {
2+
service { 'sssd':
3+
ensure => running,
4+
hasstatus => true,
5+
hasrestart => true,
6+
enable => true,
7+
require => Class['pamldap::config'],
8+
}
9+
}

0 commit comments

Comments
 (0)