source: trunk/puppet/modules/puppet-openldap/manifests/classes/client.pp @ 568

Last change on this file since 568 was 568, checked in by sebas@…, 13 years ago

agrego una class openldap::client::pammount para mountar el home remoto

File size: 2.6 KB
Line 
1#
2# used like this:
3#
4# $ldap_uri = 'ldap://ldap-server'
5# $ldap_base = 'dc=example,dc=com'
6# $ldap_ssl  = 'true'
7# if ssl is not activated just don't put the line above.
8# include openldap::client
9
10class openldap::client {
11    package { [
12        "base-files",
13        "libnss-ldap",
14        "libpam-ldap",
15        "libpam-cracklib",
16        "nscd"
17        ]: ensure => installed
18    }
19   
20    case $operatingsystem {
21        Debian: {
22            file {
23                "/etc/pam_ldap.conf":
24                    require => Package["base-files"],
25                    ensure => present,
26                    content => template("openldap/pam_ldap.conf.erb");
27                "/etc/libnss-ldap.conf":
28                    require => Package["base-files"],
29                    ensure => present,
30                    content => template("openldap/ldap.conf.erb");
31                }
32        }
33        Ubuntu: {
34            file {
35                "/etc/ldap.conf":
36                    require => Package["base-files"],
37                    ensure => present,
38                    content => template("openldap/ldap.conf.erb");
39                "/etc/ldap/ldap.conf":
40                    require => Package["base-files"],
41                    ensure => present,
42                    content => template("openldap/ldap.conf.erb");
43                }
44        }
45        default: {
46           err("Your $operatingsystem is not supported yet to configure openldap-client")
47        }
48    }
49
50    file {
51        "/etc/nsswitch.conf":
52            source => "puppet:///openldap/etc/nsswitch.conf",
53            ensure => present,
54            require => Package["base-files"];
55        "/etc/pam.d":
56            ensure  => directory,
57            mode    => 644,
58            owner   => root,
59            group   => root,
60            source  => "puppet:///openldap/etc/pam.d/",
61            recurse => "true",
62            require => Package[base-files];
63    }
64}
65
66#
67# used like this:
68#
69# $pammount_fstype = 'nfs'
70# $pammount_server = '10.0.0.2'
71# $pammount_path  = '~'
72# $pammount_mountpoint = '~'
73# include openldap::client::pammount
74
75class openldap::client::pammount {
76    package { [
77        "nfs-common",
78        "libpam-mount"
79        ]: ensure => installed
80    }
81
82    case $operatingsystem {
83        Ubuntu: {
84            file {
85                "/etc/security/pam_mount.conf.xml":
86                    require => Package["libpam-mount"],
87                    ensure => present,
88                    content => template("openldap/pam_mount.conf.xml.erb");
89                }
90        }
91        default: {
92           err("Your $operatingsystem is not supported yet to configure openldap-client")
93        }
94    }
95}
Note: See TracBrowser for help on using the repository browser.