aboutsummaryrefslogtreecommitdiffstats
path: root/modules/openldap/manifests/init.pp
blob: 417abd21f2b66dbfbf5ad40ec29ed14d8ea37264 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class openldap {
    class common {
        package { 'openldap-servers':
            ensure => installed 
        }

        service { ldap:
            ensure => running,
            subscribe => [ Package['openldap-servers']],
            path => "/etc/init.d/ldap"
        }

        file {"/etc/ssl/openldap/":
            ensure => directory,
            owner => root,
            group => root,
            mode => 755,
        }

        openssl::self_signed_cert{ "ldap.$domain":
            directory => "/etc/ssl/openldap/"
        }
    }

    # /etc/
    # 11:57:48|  blingme> misc: nothing special, just copy slapd.conf, mandriva-dit-access.conf across, slapcat one side, slapadd other side

    file { '/etc/openldap/slapd.conf':
        ensure => present,
        owner => root,
        group => root,
        mode => 644,
        require => Package["openldap-servers"],
        content => "",
        notify => [Service['ldap']]
    }

    file { '/etc/openldap/mandriva-dit-access.conf':
        ensure => present,
        owner => root,
        group => root,
        mode => 644,
        require => Package["openldap-servers"],
        content => "",
        notify => [Service['ldap']]
    }

    file { '/etc/sysconfig/ldap':
        ensure => present,
        owner => root,
        group => root,
        mode => 644,
        require => Package["openldap-servers"],
        content => "",
        notify => [Service['ldap']]
    } 

    class master inherits common {
        file { '/etc/openldap/mandriva-dit-access.conf':
            content => template("openldap/mandriva-dit-access.conf"),
        }

        $ldap_test_password = extlookup("ldap_test_password",'x')
        $ldap_test_directory = "/var/lib/ldap/test"
        file { "$ldap_test_directory":
            ensure => directory,
            group => ldap,
            owner => ldap,
            mode => 644,
        }       
 
        file { '/etc/openldap/slapd.conf':
            content => template("openldap/slapd.conf"),
        }

        file { '/etc/sysconfig/ldap':
            content => template("openldap/ldap.sysconfig"),
        }
    }
}