# # used like this: # # $ldap_uri = 'ldap://ldap-server' # $ldap_base = 'dc=example,dc=com' # $ldap_ssl = 'true' # if ssl is not activated just don't put the line above. # include openldap::client class openldap::client { package { [ "base-files", "libnss-ldap", "libpam-ldap", "libpam-cracklib", "nscd" ]: ensure => installed } case $operatingsystem { Debian: { file { "/etc/pam_ldap.conf": require => Package["base-files"], ensure => present, content => template("openldap/pam_ldap.conf.erb"); "/etc/libnss-ldap.conf": require => Package["base-files"], ensure => present, content => template("openldap/ldap.conf.erb"); } } Ubuntu: { file { "/etc/ldap.conf": require => Package["base-files"], ensure => present, content => template("openldap/ldap.conf.erb"); "/etc/ldap/ldap.conf": require => Package["base-files"], ensure => present, content => template("openldap/ldap.conf.erb"); } } default: { err("Your $operatingsystem is not supported yet to configure openldap-client") } } file { "/etc/nsswitch.conf": source => "puppet:///openldap/etc/nsswitch.conf", ensure => present, require => Package["base-files"]; "/etc/pam.d": ensure => directory, mode => 644, owner => root, group => root, source => "puppet:///openldap/etc/pam.d/", recurse => "true", require => Package[base-files]; } } # # used like this for N mount points: # $mount1 = ['nfs','10.0.0.2','~','~'] # $mount2 = ['nfs','10.0.0.2','/home/shared','/home/shared'] # $pammount = [ $mount1, $mount2 ] # include openldap::client::pammount class openldap::client::pammount { package { [ "nfs-common", "libpam-mount" ]: ensure => installed } case $operatingsystem { Ubuntu: { file { "/etc/security/pam_mount.conf.xml": require => Package["libpam-mount"], ensure => present, content => template("openldap/pam_mount.conf.xml.erb"); } } default: { err("Your $operatingsystem is not supported yet to configure openldap-client") } } }