/[adm]/puppet/modules/openldap/manifests/init.pp
ViewVC logotype

Contents of /puppet/modules/openldap/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2291 - (show annotations) (download)
Mon Jan 16 15:25:14 2012 UTC (12 years, 3 months ago) by misc
File size: 2510 byte(s)
small cleanup of openldap module service
1 class openldap {
2 define config($content) {
3 file { $name:
4 require => Package["openldap-servers"],
5 content => $content,
6 notify => [Service['ldap']]
7 }
8 }
9
10 class common {
11 package { 'openldap-servers': }
12
13 service { ldap:
14 subscribe => Package['openldap-servers'],
15 require => Openssl::Self_signed_cert["ldap.$domain"],
16 }
17
18 file {"/etc/ssl/openldap/":
19 ensure => directory,
20 }
21
22 openssl::self_signed_cert{ "ldap.$domain":
23 directory => "/etc/ssl/openldap/"
24 }
25
26 openldap::config {
27 '/etc/openldap/slapd.conf': content => "";
28 '/etc/openldap/mandriva-dit-access.conf': content => "";
29 '/etc/sysconfig/ldap': content => "";
30 }
31 }
32
33 class master inherits common {
34 Openldap::Config['/etc/openldap/mandriva-dit-access.conf'] {
35 content => template("openldap/mandriva-dit-access.conf"),
36 }
37
38 $ldap_test_password = extlookup("ldap_test_password",'x')
39 $ldap_test_directory = "/var/lib/ldap/test"
40 file { "$ldap_test_directory":
41 ensure => directory,
42 group => ldap,
43 owner => ldap,
44 require => Package["openldap-servers"],
45 before => Service['ldap'],
46 }
47
48 Openldap::Config['/etc/openldap/slapd.conf'] {
49 content => template("openldap/slapd.conf", "openldap/slapd.test.conf"),
50 }
51
52 Openldap::Config['/etc/sysconfig/ldap'] {
53 content => template("openldap/ldap.sysconfig"),
54 }
55 }
56
57 # TODO create the user for sync in ldap
58 # syntaxic sugar
59 define slave_instance($rid) {
60 # seems the inheritance do not work as I believe
61 include openldap::common
62 class { 'openldap::slave':
63 rid => $rid,
64 }
65 }
66
67 class slave($rid) inherits common {
68
69 $sync_password = extlookup("ldap_syncuser-$hostname",'x')
70
71 # same access rights as master
72 Openldap::Config['/etc/openldap/mandriva-dit-access.conf'] {
73 content => template("openldap/mandriva-dit-access.conf"),
74 }
75
76 Openldap::Config['/etc/openldap/slapd.conf'] {
77 content => template("openldap/slapd.conf",'openldap/slapd.syncrepl.conf'),
78 }
79
80 Openldap::Config['/etc/sysconfig/ldap'] {
81 content => template("openldap/ldap.sysconfig"),
82 }
83 }
84 }

  ViewVC Help
Powered by ViewVC 1.1.30